Skip to main content

panproto_xrpc/
lib.rs

1#![allow(clippy::future_not_send)]
2//! # panproto-xrpc
3//!
4//! XRPC client for panproto node VCS operations.
5//!
6//! Implements the `dev.panproto.node.*` XRPC endpoints for push/pull/clone
7//! of panproto-vcs objects between local stores and remote nodes.
8//!
9//! ## Endpoints
10//!
11//! | Method | Endpoint | Description |
12//! |--------|----------|-------------|
13//! | GET | `getObject` | Fetch content-addressed object (msgpack) |
14//! | POST | `putObject` | Store object (auth required) |
15//! | GET | `getRef` | Resolve ref to object ID |
16//! | POST | `setRef` | Update ref (auth required) |
17//! | GET | `listRefs` | List all refs |
18//! | GET | `getHead` | Get HEAD state |
19//! | POST | `negotiate` | Have/want negotiation for efficient transfer |
20//! | GET | `getRepoInfo` | Repository metadata |
21//! | GET | `listCommits` | Walk commit history from a ref |
22//! | GET | `diffCommits` | Schema diff between two commits |
23//!
24//! ## Push flow
25//!
26//! 1. List local refs
27//! 2. Negotiate (send local object IDs, get needed IDs)
28//! 3. `putObject` for each needed object
29//! 4. `setRef` for each ref
30//!
31//! ## Pull flow
32//!
33//! 1. `listRefs` on remote
34//! 2. Negotiate (send local object IDs, want remote refs)
35//! 3. `getObject` for each needed object, store locally
36//! 4. Update local refs
37
38/// XRPC client for panproto node operations.
39pub mod client;
40
41/// Error types for XRPC operations.
42pub mod error;
43
44pub use client::{
45    CommitEntry, CommitIdentity, DiffCommitsResult, FileDiff, ListCommitsResult, NegotiateResult,
46    NodeClient, PullResult, PushResult, RepoInfo,
47};
48pub use error::XrpcError;