pub struct GarnixClient { /* private fields */ }
Expand description
HTTP client for Garnix.io API
Implementations§
Source§impl GarnixClient
impl GarnixClient
Sourcepub fn with_base_url(base_url: impl Into<String>) -> Self
pub fn with_base_url(base_url: impl Into<String>) -> Self
Create a new Garnix client with custom base URL
Sourcepub fn with_client(client: Client) -> Self
pub fn with_client(client: Client) -> Self
Create a new Garnix client with custom HTTP client
Sourcepub fn with_client_and_url(client: Client, base_url: impl Into<String>) -> Self
pub fn with_client_and_url(client: Client, base_url: impl Into<String>) -> Self
Create a new Garnix client with custom HTTP client and base URL
Sourcepub async fn fetch_build_status(
&self,
jwt_token: &str,
commit_id: &str,
) -> Result<GarnixResponse, GarnixError>
pub async fn fetch_build_status( &self, jwt_token: &str, commit_id: &str, ) -> Result<GarnixResponse, GarnixError>
Fetch build status for a specific commit
§Arguments
jwt_token
- JWT authentication token for Garnix.io APIcommit_id
- Git commit hash to fetch build status for
§Returns
Returns a GarnixResponse
containing build summary and individual build details
§Errors
Returns GarnixError
on network errors, authentication failures, or API errors
Sourcepub async fn fetch_build_logs(
&self,
jwt_token: &str,
build_id: &str,
) -> Result<LogResponse, GarnixError>
pub async fn fetch_build_logs( &self, jwt_token: &str, build_id: &str, ) -> Result<LogResponse, GarnixError>
Fetch build logs for a specific build
§Arguments
jwt_token
- JWT authentication token for Garnix.io APIbuild_id
- Unique build ID to fetch logs for
§Returns
Returns a LogResponse
containing log entries and completion status
§Errors
Returns GarnixError
on network errors, authentication failures, or API errors
Sourcepub async fn validate_token(&self, jwt_token: &str) -> Result<(), GarnixError>
pub async fn validate_token(&self, jwt_token: &str) -> Result<(), GarnixError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GarnixClient
impl !RefUnwindSafe for GarnixClient
impl Send for GarnixClient
impl Sync for GarnixClient
impl Unpin for GarnixClient
impl !UnwindSafe for GarnixClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more