-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): Add Edge app bootstraping config
- Loading branch information
Showing
3 changed files
with
83 additions
and
24 deletions.
There are no files selected for viewing
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,43 @@ | ||
/// Defines an HTTP request. | ||
#[derive( | ||
schemars::JsonSchema, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug, | ||
)] | ||
pub struct HttpRequest { | ||
/// Request path. | ||
pub path: String, | ||
|
||
/// HTTP method. | ||
/// | ||
/// Defaults to GET. | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub method: Option<String>, | ||
|
||
/// Request body as a string. | ||
pub body: Option<String>, | ||
|
||
/// Request timeout. | ||
/// | ||
/// Format: 1s, 5m, 11h, ... | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub timeout: Option<String>, | ||
|
||
pub expect: Option<HttpRequestExpect>, | ||
} | ||
|
||
/// Validation checks for an [`HttpRequest`]. | ||
#[derive( | ||
schemars::JsonSchema, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug, | ||
)] | ||
pub struct HttpRequestExpect { | ||
/// Expected HTTP status codes. | ||
#[serde(skip_serializing_if = "Vec::is_empty")] | ||
pub status_codes: Vec<u16>, | ||
|
||
/// Text that must be present in the response body. | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub body_includes: Option<String>, | ||
|
||
/// Regular expression that must match against the response body. | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub body_regex: Option<String>, | ||
} |
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