-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
query_account
to jetstream::Context
- Loading branch information
1 parent
efc1bbd
commit e2c365f
Showing
4 changed files
with
92 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use std::collections::HashMap; | ||
|
||
#[derive(Debug, Default, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ||
pub struct Limits { | ||
/// Maximum memory for this account (-1 if no limit) | ||
pub max_memory: i64, | ||
/// Maximum storage for this account (-1 if no limit) | ||
pub max_storage: i64, | ||
/// Maximum streams for this account (-1 if no limit) | ||
pub max_streams: i64, | ||
/// Maximum consumers for this account (-1 if no limit) | ||
pub max_consumers: i64, | ||
/// Indicates if Streams created in this account requires the max_bytes property set | ||
pub max_bytes_required: bool, | ||
/// The maximum number of outstanding ACKs any consumer may configure | ||
pub max_ack_pending: i64, | ||
/// The maximum size any single memory stream may be | ||
pub memory_max_stream_bytes: i64, | ||
/// The maximum size any single storage based stream may be | ||
pub storage_max_stream_bytes: i64, | ||
} | ||
|
||
#[derive(Debug, Default, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ||
pub struct Requests { | ||
/// Total number of requests received for this account. | ||
pub total: u64, | ||
/// Total number of requests that resulted in an error response. | ||
pub errors: u64, | ||
} | ||
|
||
#[derive(Debug, Default, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] | ||
pub struct Tier { | ||
/// Memory Storage being used for Stream Message storage | ||
pub memory: u64, | ||
/// File Storage being used for Stream Message storage | ||
pub storage: u64, | ||
/// Number of active Streams | ||
pub streams: usize, | ||
/// Number of active Consumers | ||
pub consumers: usize, | ||
/// | ||
pub limits: Limits, | ||
pub requests: Requests, | ||
} | ||
|
||
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq, Eq)] | ||
pub struct Account { | ||
pub memory: u64, | ||
pub storage: u64, | ||
pub streams: usize, | ||
pub consumers: usize, | ||
pub domain: Option<String>, | ||
pub limits: Limits, | ||
#[serde(rename = "api")] | ||
pub requests: Requests, | ||
#[serde(default)] | ||
pub tiers: HashMap<String, Tier>, | ||
} |
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 |
---|---|---|
|
@@ -85,6 +85,7 @@ | |
use crate::{Client, Error}; | ||
|
||
pub mod account; | ||
pub mod consumer; | ||
pub mod context; | ||
pub mod publish; | ||
|
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