sidecar

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 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 sidecar streams checked records through bounded scratch.

Index

Constants

View Source
const OrdinalFooterBytes = 32 + 8 + 4

OrdinalFooterBytes includes the manifest binding, record count, and checksum.

View Source
const ScratchBytes = 32 << 10

ScratchBytes bounds the encoder buffer shared by sequential sidecar writes.

Variables

This section is empty.

Functions

func CheckOrdinalFooter

func CheckOrdinalFooter(footer []byte, binding [32]byte, count int, checksum uint32) error

CheckOrdinalFooter validates the expected binding, record count, and checksum.

func OrdinalBody

func OrdinalBody(raw []byte, binding [32]byte, count int) ([]byte, error)

OrdinalBody validates a complete sidecar and returns its encoded records.

func Write

func Write(ctx context.Context, b backend.Backend, key string, header []byte, count, maxEntry int, entry func([]byte, int) []byte) error

Write emits header, records and a big-endian CRC without a whole-object encoding buffer.

func WriteChecked

func WriteChecked(ctx context.Context, b backend.Backend, key string, header []byte,
	count, maxEntry int, entry func([]byte, int) ([]byte, error),
) error

WriteChecked streams records from a source that can fail.

Types

type OrdinalWriter

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

OrdinalWriter streams records whose order is supplied by the part's series index.

func OpenOrdinalWriter

func OpenOrdinalWriter(ctx context.Context, b backend.Backend, key string, magic uint32) (*OrdinalWriter, error)

OpenOrdinalWriter starts a deferred sidecar with the given format tag.

func (*OrdinalWriter) Abort

func (w *OrdinalWriter) Abort()

Abort releases the buffer and discards any uncommitted output.

func (*OrdinalWriter) Append

func (w *OrdinalWriter) Append(ctx context.Context, record []byte) error

Append adds one encoded record to the stream.

func (*OrdinalWriter) Commit

func (w *OrdinalWriter) Commit(ctx context.Context, binding [32]byte, count int) error

Commit checksums the stream and publishes it with its binding and record count.

Jump to

Keyboard shortcuts

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