Documentation
¶
Overview ¶
Package journal implements beardrive's append-only operation log.
Every change to a volume is recorded as an Op in a per-device JSONL journal. Journals are append-only and each device only ever writes its own journal, so syncing is conflict-free at the transport level: a sync uploads your journal and downloads everyone else's. The merged view of a volume is a deterministic replay of the union of all ops ordered by (lamport, time, device, seq) — every device converges to the same state.
Index ¶
Constants ¶
View Source
const ( KindPut = "put" KindDelete = "delete" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Op ¶
type Op struct {
Seq int64 `json:"seq"` // per-device sequence number, 1-based
Lamport int64 `json:"lamport"` // logical clock for cross-device ordering
Time time.Time `json:"time"`
Device string `json:"device"`
DeviceName string `json:"device_name,omitempty"`
Author string `json:"author,omitempty"` // OS/git identity (offline fallback)
User string `json:"user,omitempty"` // signed-in account email
UserName string `json:"user_name,omitempty"` // signed-in account display name
Kind string `json:"kind"` // "put" or "delete"
Path string `json:"path"` // slash-separated, relative to volume root
Blob string `json:"blob,omitempty"` // sha256 hex of content (put only)
Size int64 `json:"size,omitempty"`
Mode uint32 `json:"mode,omitempty"` // permission bits
Note string `json:"note,omitempty"` // e.g. "conflict copy of <path>"
}
Op is a single journaled file operation.
Click to show internal directories.
Click to hide internal directories.