Skip to content

Commit 11d8731

Browse files
committed
docs: [torrust#266] crate docs for servers::http mod
1 parent 15779a5 commit 11d8731

37 files changed

Lines changed: 1269 additions & 38 deletions

cSpell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"automock",
66
"Avicora",
77
"Azureus",
8+
"bdecode",
89
"bencode",
910
"bencoded",
1011
"beps",
@@ -56,6 +57,7 @@
5657
"reannounce",
5758
"repr",
5859
"reqwest",
60+
"rerequests",
5961
"rngs",
6062
"rusqlite",
6163
"rustfmt",

packages/configuration/src/lib.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,29 @@ pub struct Configuration {
6464
pub db_driver: DatabaseDriver,
6565
pub db_path: String,
6666

67-
/// Interval in seconds that the client should wait between sending regular announce requests to the tracker
67+
/// Interval in seconds that the client should wait between sending regular
68+
/// announce requests to the tracker.
69+
///
70+
/// It's a **recommended** wait time between announcements.
71+
///
72+
/// This is the standard amount of time that clients should wait between
73+
/// sending consecutive announcements to the tracker. This value is set by
74+
/// the tracker and is typically provided in the tracker's response to a
75+
/// client's initial request. It serves as a guideline for clients to know
76+
/// how often they should contact the tracker for updates on the peer list,
77+
/// while ensuring that the tracker is not overwhelmed with requests.
6878
pub announce_interval: u32,
69-
/// Minimum announce interval. Clients must not reannounce more frequently than this
79+
/// Minimum announce interval. Clients must not reannounce more frequently
80+
/// than this.
81+
///
82+
/// It establishes the shortest allowed wait time.
83+
///
84+
/// This is an optional parameter in the protocol that the tracker may
85+
/// provide in its response. It sets a lower limit on the frequency at which
86+
/// clients are allowed to send announcements. Clients should respect this
87+
/// value to prevent sending too many requests in a short period, which
88+
/// could lead to excessive load on the tracker or even getting banned by
89+
/// the tracker for not adhering to the rules.
7090
pub min_announce_interval: u32,
7191
pub on_reverse_proxy: bool,
7292
pub external_ip: Option<String>,

src/lib.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@
3333
//! - [Run with docker](#run-with-docker)
3434
//! - [Configuration](#configuration)
3535
//! - [Usage](#usage)
36+
//! - [API](#api)
37+
//! - [HTTP Tracker](#http-tracker)
38+
//! - [UDP Tracker](#udp-tracker)
3639
//! - [Components](#components)
3740
//! - [Implemented BEPs](#implemented-beps)
3841
//! - [Contributing](#contributing)
42+
//! - [Documentation](#documentation)
3943
//!
4044
//! # Features
4145
//!
@@ -181,7 +185,7 @@
181185
//! - UDP tracker: <http://localhost:6969>
182186
//! - HTTP tracker: <http://localhost:7070>
183187
//!
184-
//! ## API usage
188+
//! ## API
185189
//!
186190
//! In order to use the tracker API you need to enable it in the configuration:
187191
//!
@@ -231,7 +235,7 @@
231235
//!
232236
//! Refer to the [`API`](crate::servers::apis) documentation for more information about the [`API`](crate::servers::apis) endpoints.
233237
//!
234-
//! ## HTTP tracker usage
238+
//! ## HTTP tracker
235239
//!
236240
//! The HTTP tracker implements two type of requests:
237241
//!
@@ -331,7 +335,7 @@
331335
//! You can also use the Torrust Tracker together with the [Torrust Index](https://github.com/torrust/torrust-index). If that's the case,
332336
//! the Index will create the keys by using the tracker [API](crate::servers::apis).
333337
//!
334-
//! ## UDP tracker usage
338+
//! ## UDP tracker
335339
//!
336340
//! The UDP tracker also implements two type of requests:
337341
//!
@@ -430,6 +434,15 @@
430434
//! # Contributing
431435
//!
432436
//! If you want to contribute to this documentation you can [open a new pull request](https://github.com/torrust/torrust-tracker/pulls).
437+
//!
438+
//! # Documentation
439+
//!
440+
//! You can find this documentation on [docs.rs](https://docs.rs/torrust-tracker/).
441+
//!
442+
//! If you want to contribute to this documentation you can [open a new pull request](https://github.com/torrust/torrust-tracker/pulls).
443+
//!
444+
//! In addition to the production code documentation you can find a lot of
445+
//! examples on the integration and unit tests.
433446
pub mod app;
434447
pub mod bootstrap;
435448
pub mod servers;

0 commit comments

Comments
 (0)