generated from Patagia/template-nix
parent
da210ffc16
commit
31c8921aca
13 changed files with 246 additions and 36 deletions
controller/src
|
@ -1,7 +1,7 @@
|
|||
use dropshot::{endpoint, HttpError, HttpResponseOk, RequestContext};
|
||||
use schemars::JsonSchema;
|
||||
use serde::Serialize;
|
||||
use tracing::Instrument;
|
||||
use trace_request::trace_request;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -19,16 +19,7 @@ struct VersionInfo {
|
|||
method = GET,
|
||||
path = "/version",
|
||||
}]
|
||||
#[tracing::instrument(
|
||||
skip(rqctx),
|
||||
fields(
|
||||
http.method=rqctx.request.method().as_str(),
|
||||
http.path=rqctx.request.uri().path(),
|
||||
http.remote_ip=rqctx.request.remote_addr().ip().to_string(),
|
||||
request_id = rqctx.request_id,
|
||||
),
|
||||
err(Debug),
|
||||
)]
|
||||
#[trace_request]
|
||||
pub(crate) async fn version(
|
||||
rqctx: RequestContext<Arc<ControllerContext>>,
|
||||
) -> Result<HttpResponseOk<VersionInfo>, HttpError> {
|
||||
|
@ -45,5 +36,6 @@ pub(crate) async fn version(
|
|||
}
|
||||
.instrument(tracing::info_span!("Let's do the thing...."))
|
||||
.await;
|
||||
|
||||
Ok(HttpResponseOk(ver))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue