Improve the documentation and bug fixes #3

Merged
dorian merged 13 commits from improve-docs into main 2024-02-24 20:41:15 -05:00
1 changed files with 11 additions and 4 deletions
Showing only changes of commit aca5a57460 - Show all commits

View File

@ -1,8 +1,4 @@
#![warn(missing_docs)]
#![doc = include_str!("../README.md")]
/// ## Usage
///
use axum::{
extract::{Host, Json, OriginalUri},
@ -16,6 +12,11 @@ use std::collections::BTreeMap;
use tower_http::trace;
use tracing::{info, warn, Level};
/// CLI arguments used by the [Parser].
///
/// Creates the usage and version information that is standard in a CLI
/// utility.
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
struct CliArgs {
@ -28,12 +29,18 @@ struct CliArgs {
ips: String,
}
/// The response consisting of the echoed request to the mirror-server.
#[derive(Serialize, Deserialize, Debug, PartialEq)]
struct EchoResponse {
/// The [Method] used in the request.
method: String,
/// The path used in the request.
path: String,
/// The original schema, hostname and port of the request.
host: String,
/// The headers in the request.
headers: BTreeMap<String, String>,
/// (Optional) The JSON body in the request.
#[serde(skip_serializing_if = "Option::is_none")]
body: Option<Value>,
}