gitfox_client/lib.rs
1//! `gitfox-client` — a Rust client for the GitFox API.
2//!
3//! This crate knows about HTTP and about GitFox. It knows nothing about
4//! terminals, tables, exit codes or configuration files. That separation is
5//! what lets `fx` (the CLI) and, later, `fx-mcp` (the MCP server) share one
6//! implementation instead of the MCP server shelling out to the CLI.
7//!
8//! ```no_run
9//! # async fn example() -> Result<(), gitfox_client::Error> {
10//! use gitfox_client::GitFoxClient;
11//!
12//! let client = GitFoxClient::builder("https://git.example.com")
13//! .token(Some("…".to_string()))
14//! .build()?;
15//! let user = client.auth().current_user().await?;
16//! println!("{}", user.label());
17//! # Ok(())
18//! # }
19//! ```
20
21pub mod auth;
22pub mod client;
23pub mod error;
24pub mod models;
25pub mod pipeline;
26pub mod principal;
27pub mod pull_request;
28pub mod repo;
29
30pub use client::{
31 DEFAULT_RETRIES, DEFAULT_TIMEOUT_SECS, GitFoxClient, GitFoxClientBuilder, Method, Query,
32 RawResponse, is_retryable_method,
33};
34pub use error::{Error, Result};
35pub use models::{
36 Check, CiStatus, CreatePullRequest, Execution, FileDiff, LogLine, MergeMethod,
37 MergePullRequest, MergeResult, Pipeline, Principal, PullRequest, PullRequestCheck,
38 PullRequestChecks, PullRequestState, PullRequestStats, RepoRef, Repository, Stage, Step, User,
39};
40pub use pull_request::PullRequestFilter;
41pub use repo::RepoSort;