Documentation
¶
Overview ¶
Package records encodes and authenticates the transport-neutral file-revision and block-record objects used by the v2 content plane.
Index ¶
Constants ¶
const ( RevisionSchemaVersion = 2 SchemaVersion = 1 MaxRevisionPayloadBytes = 16 << 10 MaxBlockRecordObjectBytes = (4 << 20) + 512 )
Variables ¶
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 (r BlockRecord) Descriptor() content.FileRevisionDescriptor
func (BlockRecord) LocalBlockIndex ¶
func (r BlockRecord) LocalBlockIndex() uint64
type Decoder ¶ added in v0.1.4
type Decoder struct {
}
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
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