Skip to main content

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 `gf` (the CLI) and, later, `gf-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 labels;
25pub mod models;
26pub mod pipeline;
27pub mod principal;
28pub mod pull_request;
29pub mod repo;
30pub mod rules;
31pub mod spaces;
32
33pub use client::{
34    DEFAULT_RETRIES, DEFAULT_TIMEOUT_SECS, GitFoxClient, GitFoxClientBuilder, Method, Query,
35    RawResponse, is_retryable_method,
36};
37pub use error::{Error, Result};
38pub use models::{
39    Check, CheckCountSummary, CiStatus, CodeComment, Commit, Content, ContentEntry, CreateGitspace,
40    CreatePullRequest, CreateRepository, Execution, FileDiff, Gitspace, GitspaceInstance, Identity,
41    LABEL_COLORS, Label, LabelAssignment, LabelInput, LabelValue, LabelValueInfo, LicenseTemplate,
42    LogLine, Membership, MergeMethod, MergePullRequest, MergeResult, Pipeline, Principal,
43    PublicKey, PullRequest, PullRequestActivity, PullRequestCheck, PullRequestChecks,
44    PullRequestLabel, PullRequestLabels, PullRequestReviewer, PullRequestState, PullRequestStats,
45    RepoRef, Repository, ReviewDecision, Rule, Signature, Space, SpaceSecret, Stage, Step,
46    SystemConfig, UpdatePullRequest, User, decode_base64, encode_base64, label_color,
47    label_color_hex,
48};
49pub use pull_request::PullRequestFilter;
50pub use repo::RepoSort;