records

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package records encodes and authenticates the transport-neutral file-revision and block-record objects used by the v2 content plane.

Index

Constants

View Source
const (
	RevisionSchemaVersion     = 2
	SchemaVersion             = 1
	MaxRevisionPayloadBytes   = 16 << 10
	MaxBlockRecordObjectBytes = (4 << 20) + 512
)

Variables

View Source
var (
	ErrInvalidRecord      = errors.New("content record is invalid")
	ErrObjectTooLarge     = errors.New("content record exceeds its limit")
	ErrObjectIdentity     = errors.New("content record has the wrong identity")
	ErrNonCanonicalObject = errors.New("content record is not canonical CBOR")
)

Functions

This section is empty.

Types

type BlockRecord

type BlockRecord struct {
	// contains filtered or unexported fields
}

BlockRecord owns plaintext from exactly one file-local block. Its identity is semantic; RecordID commits to its canonical encoded payload.

func NewBlockRecord

func NewBlockRecord(descriptor content.FileRevisionDescriptor, index uint64, data []byte) (BlockRecord, error)

func (BlockRecord) Data

func (r BlockRecord) Data() []byte

func (BlockRecord) DataLength

func (r BlockRecord) DataLength() int

func (BlockRecord) Descriptor

func (BlockRecord) LocalBlockIndex

func (r BlockRecord) LocalBlockIndex() uint64

type Decoder added in v0.1.4

type Decoder struct {
	ShareInstance catalog.ShareInstance
}

Decoder interprets payloads delivered by the authenticated operation. The request and lease still determine which identities and sizes are admissible.

func (Decoder) DecodeBlock added in v0.1.4

func (d Decoder) DecodeBlock(descriptor content.FileRevisionDescriptor, index uint64, payload []byte) (BlockRecord, error)

func (Decoder) DecodeRevision added in v0.1.4

func (d Decoder) DecodeRevision(file catalog.FileID, chunkSize uint32, payload []byte) (content.FileRevisionDescriptor, error)

type Encoder added in v0.1.4

type Encoder struct{}

Encoder produces immutable payloads that a session can frame for any recipient. Live lease validation stays with the sender service.

func (Encoder) EncodeBlock added in v0.1.4

func (Encoder) EncodeBlock(record BlockRecord) ([]byte, error)

func (Encoder) EncodeRevision added in v0.1.4

func (Encoder) EncodeRevision(descriptor content.FileRevisionDescriptor) ([]byte, error)

type RecordID

type RecordID [catalog.IdentityBytes]byte

func RecordIDFromBytes

func RecordIDFromBytes(raw []byte) (RecordID, error)

func RecordIDFromObject

func RecordIDFromObject(object []byte) RecordID

func (RecordID) Bytes

func (id RecordID) Bytes() []byte

func (RecordID) IsZero

func (id RecordID) IsZero() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL