Improve the documentation and bug fixes #3
15
src/main.rs
15
src/main.rs
|
@ -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>,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue