Storage Data Model

Segment Model

segment.Segment and segment.Offer define the relay payload and pre-check metadata. Integrity is modeled as a BLAKE3 hash (BLAKE3Hash) and size recorded in metadata/index entries.

Index Structure

index.Entry stores:

  • ID

  • BLAKE3Hash

  • Size

  • DurabilityClass

  • ReceivedAt, LastSeenAt, optional EvictedAt

The index supports duplicate detection and retention-window semantics for evicted IDs.

Local Store API

storage.Store contract includes:

  • Write, Read, Delete

  • DiskUsed, Stats, Close

Error sentinels include ErrCeilingExceeded, ErrNotFound, ErrPathEscape, ErrCorrupt.

Disk Usage Accounting

Disk usage is defined as kernel-reported statfs output (not user-space estimates). WithDiskUsedFunc exists for deterministic unit tests.

Evidence

  • edge/segment/segment.go

  • edge/index/index.go

  • edge/storage/store.go

  • edge/storage/localstore.go

  • edge/storage/store_test.go

See Also