-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wip): skeleton for new API endpoints
- Loading branch information
Zoe Spellman
committed
Mar 1, 2024
1 parent
962d6e3
commit 1a67201
Showing
11 changed files
with
141 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! The public interface of this endpoint | ||
use chrono::{DateTime, Utc}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// The request for getting the API Version, this is empty because | ||
/// Any query will return the given response (authentication happens | ||
// at a higher layer). | ||
#[derive(Copy, Clone, Deserialize, Serialize)] | ||
pub struct ApiVersionRequest; | ||
|
||
#[derive(Clone, Serialize, Deserialize)] | ||
/// The response returning the API Version information. | ||
pub struct ApiVersionResponse { | ||
/// The current API Version | ||
version: String, | ||
/// The current commit sha | ||
commit: String, | ||
/// The timestamp this build was done at | ||
build: DateTime<Utc>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! Contains API endpoints for getting build target information for the currently running service | ||
pub mod interface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//! The public interface for getting the log level | ||
use log::Level; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// The request for getting the log level, empty because | ||
/// the request is empty. | ||
#[derive(Copy, Clone, Deserialize, Serialize)] | ||
pub struct GetLogLevelRequest; | ||
|
||
/// The response for getting the leg level, [`tracing`] doesn't implement | ||
/// [`Serialize`] so we use the one from [`log`] as an intermediary. | ||
#[derive(Copy, Clone, Deserialize, Serialize)] | ||
pub struct GetLogLevelResponse { | ||
/// The log level we currently are at | ||
level: Level, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! The interface for setting the current log level | ||
mod interface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//! Contains API endpoints for manipulating the log level | ||
pub mod get; | ||
pub mod set; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! The public interface for defining setting the log level | ||
use log::Level; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// The request for setting the log level | ||
#[derive(Copy, Clone, Serialize, Deserialize)] | ||
pub struct SetLogLevelRequest { | ||
/// The current log level, [`tracing`] doesn't implement [`serde`] so | ||
// we convert between the two internally. | ||
level: Level, | ||
} | ||
|
||
/// The response for setting the log level, essentially nothing but an Ack | ||
#[derive(Copy, Clone, Serialize, Deserialize)] | ||
pub struct SetLogLevelResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! The endpoint for getting the current log level | ||
mod interface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//! Contains API endpoints for administrative features | ||
mod api_version; | ||
mod log_level; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters