diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-09 21:43:23 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-09 21:43:23 +0200 |
| commit | 3223d93cb3c77ab02aa0a35f2a8314e447cee9a4 (patch) | |
| tree | 3971a1f37f5fe3cadb747c5229a0d54e868e45e3 /crates/client/src/atuin_common/api.rs | |
| parent | fix(client/sync): Pass through precise error on `SyncError::WrongKey` (diff) | |
| download | atuin-3223d93cb3c77ab02aa0a35f2a8314e447cee9a4.zip | |
chore: Separate daemon, client, server, and lib into crates
Diffstat (limited to 'crates/client/src/atuin_common/api.rs')
| -rw-r--r-- | crates/client/src/atuin_common/api.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/client/src/atuin_common/api.rs b/crates/client/src/atuin_common/api.rs new file mode 100644 index 00000000..0868943d --- /dev/null +++ b/crates/client/src/atuin_common/api.rs @@ -0,0 +1,22 @@ +use semver::Version; +use serde::{Deserialize, Serialize}; +use std::borrow::Cow; +use std::sync::LazyLock; + +// the usage of X- has been deprecated for quite along time, it turns out +pub(crate) static ATUIN_HEADER_VERSION: &str = "Atuin-Version"; +pub(crate) static ATUIN_CARGO_VERSION: &str = env!("CARGO_PKG_VERSION"); + +pub(crate) static ATUIN_VERSION: LazyLock<Version> = + LazyLock::new(|| Version::parse(ATUIN_CARGO_VERSION).expect("failed to parse self semver")); + +#[derive(Debug, Serialize, Deserialize)] +pub(crate) struct ErrorResponse<'a> { + pub(crate) reason: Cow<'a, str>, +} + +#[derive(Debug, Serialize, Deserialize)] +pub(crate) struct IndexResponse { + pub(crate) homage: String, + pub(crate) version: String, +} |
