Skip to main content

guts_p2p/
lib.rs

1//! P2P networking layer for Guts decentralized code collaboration.
2//!
3//! This crate provides the peer-to-peer networking infrastructure for
4//! replicating git repositories and collaboration data across multiple nodes.
5
6mod collaboration_message;
7mod error;
8mod message;
9mod protocol;
10
11pub use collaboration_message::{
12    CollaborationMessage, CollaborationMessageType, SerializableComment, SerializableIssue,
13    SerializableLabel, SerializablePullRequest, SerializableReview,
14};
15pub use error::P2PError;
16pub use message::{Message, MessageType, ObjectData, RefUpdate, RepoAnnounce, SyncRequest};
17pub use protocol::{ReplicationHandler, ReplicationProtocol};
18
19/// Channel ID for replication messages.
20pub const REPLICATION_CHANNEL: u64 = 1;
21
22/// Maximum message size for replication (10 MB).
23pub const MAX_MESSAGE_SIZE: usize = 10 * 1024 * 1024;
24
25/// Result type for P2P operations.
26pub type Result<T> = std::result::Result<T, P2PError>;