Skip to main content

Module sync

Module sync 

Source
Expand description

Minimal sync contracts and local implementations.

Structs§

FileReplicationLog
File-backed append-only replication log for local Runtime sync.
FileSyncCheckpointStore
File-backed checkpoint store (line-based peer=sequence,hash).
FileSyncOutbox
Crash-consistent incremental file-backed synchronization outbox.
FollowerSyncClient
Pushes leader events to a follower over transport.
HeartbeatMessage
Transport-neutral heartbeat message.
HttpSyncTransport
Bounded blocking HTTP client for leader-to-follower sync batches.
InMemoryReplicationLog
In-memory replication log for local sync scenarios.
InMemorySyncCheckpointStore
In-memory checkpoint store for tests/local runtime.
InMemorySyncConflictStore
Bounded process-local conflict store for Runtime/UI coordination.
InMemorySyncOutbox
Process-local synchronization outbox.
PeerInfo
Peer metadata used by sync orchestration.
ReplicationSnapshot
Integrity-protected portable image of a replication log.
ReplicationSnapshotRecord
Sequence-addressed event stored in a replication snapshot.
SyncChunkAssembler
Bounded assembler for out-of-order and resumable sync chunks.
SyncChunkProgress
Payload-free progress information for a resumable transfer.
SyncChunkRange
A missing byte range in a resumable transfer.
SyncConflict
Payload-free conflict observation suitable for a UI or diagnostics API.
SyncConflictResolutionReceipt
Result of applying or replaying a conflict resolution.
SyncConflictResolutionRequest
Idempotent resolution command for one conflict.
SyncEnvelopeV1
Versioned sync envelope carrying the complete distributed source identity.
SyncMessage
Mensagem de replicação enviada do líder para o seguidor.
SyncOutboxReceipt
Bounded acknowledgement for an ordered prefix of the outbox.
SyncOutboxStats
Bounded outbox observations without message payloads.
SyncPayloadChunk
A bounded portion of an opaque sync payload.
SyncPeerAddress
Parsed and normalized address of a synchronization peer.
SyncPushMetrics
Basic sync push metrics for local observability.
SyncReceiveAck
Ack returned by /v1/sync/events.
SyncReceiverState
In-memory receiver state for follower sync endpoint.
SyncRetryPolicy
Retry and queue limits for follower push.

Enums§

NodeRole
Node role used by leader election and write routing.
SyncChunkInsert
Result of inserting a chunk into an assembler.
SyncConflictKind
Generic replication conflict category, independent of application schema.
SyncConflictResolution
Operator or application choice recorded for one conflict.
SyncError
Sync-local typed errors.
SyncPeerScheme
HTTP scheme supported by the built-in synchronization transport.
SyncStatus
Coarse sync health and progress status.

Constants§

MAX_CHECKPOINT_FILE_BYTES
Maximum bytes accepted in one checkpoint file.
MAX_CHECKPOINT_PEER_ID_BYTES
Maximum UTF-8 bytes accepted in one checkpoint peer identifier.
MAX_CHECKPOINT_RECORDS
Maximum non-empty records accepted in one checkpoint file.
MAX_CONFLICT_ID_BYTES
Maximum UTF-8 bytes accepted for a conflict identity field.
MAX_CONFLICT_REASON_BYTES
Maximum UTF-8 bytes accepted for a conflict reason.
MAX_OUTBOX_PAGE_BYTES
Maximum encoded message bytes returned by one bounded outbox read.
MAX_OUTBOX_PAGE_MESSAGES
Maximum number of messages returned by one bounded outbox read.
MAX_REPLICATION_PAGE_BYTES
Maximum aggregate payload bytes returned by one replication-log page.
MAX_REPLICATION_PAGE_RECORDS
Maximum records returned by one bounded replication-log page.
MAX_SYNC_BATCH_PAYLOAD_BYTES
Maximum raw event bytes grouped into one Runtime HTTP sync batch.
MAX_SYNC_CHUNKS
Maximum chunks retained by one assembler.
MAX_SYNC_CHUNK_BYTES
Maximum bytes carried by one resumable chunk.
MAX_SYNC_CHUNK_TOTAL_BYTES
Maximum bytes accepted for one chunked transfer.
MAX_SYNC_CONFLICTS
Maximum conflicts retained by the in-memory resolution registry.
MAX_SYNC_REQUEST_BODY_BYTES
Maximum encoded V1 sync envelope accepted by the default HTTP transport.
MAX_SYNC_TRANSFER_ID_BYTES
Maximum transfer identifier length.
REPLICATION_LOG_FORMAT_V1
Stable on-disk format marker for hash-chained replication logs.
SYNC_CHECKPOINT_FORMAT_V1
Stable on-disk format marker for peer checkpoints.
SYNC_OUTBOX_FORMAT_V2
Stable on-disk format marker for incremental durable sync outboxes. Stable on-disk format marker for incremental durable sync outboxes.
SYNC_SNAPSHOT_FORMAT_V1
Stable format version for portable replication snapshots.
SYNC_WIRE_SCHEMA_V1
Schema identifier for the first identity-aware sync wire envelope.

Traits§

LeaderElection
Leader election contract.
ReplicationLog
Replication log contract.
SyncCheckpointStore
Sync checkpoint storage contract by peer id.
SyncConflictStore
Conflict registry contract with idempotent recording and resolution.
SyncOutbox
Ordered bounded queue that retains replication batches until acknowledgement.
SyncTransport
Sync transport contract.

Functions§

compute_events_hash
Computes the SHA-256 hash of events payload deterministically including size prefixes and batch metadata.
decode_sync_envelope
Decodes the identity-aware v1 JSON envelope.
decode_sync_message
Decodes a versioned v1 envelope and returns its replication message.
discover_dns_sync_peers
Resolves DNS peer seeds and returns normalized, de-duplicated addresses.
encode_sync_envelope_v1
Encodes an identity-aware v1 envelope as JSON.
encoded_sync_message_bytes
Returns the exact compact JSON byte length of a synchronization message.
split_sync_payload
Splits one opaque payload into bounded chunks with resumable metadata.
write_sync_message_json
Writes the compact JSON representation used by SyncMessage serialization.

Type Aliases§

SyncResult
Sync-local result type.