Documentation ¶
Overview ¶
Package internal provides some helpers used by packing implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckLocationSet ¶
CheckLocationSet checks whether the previous block's Location field was set, to prevent misuse of the BlockPacker API.
Types ¶
type BlockTracker ¶
type BlockTracker struct { // Block is the index of the current block. Block int // contains filtered or unexported fields }
BlockTracker maintains an index into a slice of upspin.DirBlock.
func NewBlockTracker ¶
func NewBlockTracker(bs []upspin.DirBlock) BlockTracker
NewBlockTracker returns a BlockTracker that iterates over the given slice.
type LazyBuffer ¶
type LazyBuffer []byte
LazyBuffer is a []byte that is lazily (re-)allocated when its Bytes method is called.
func (*LazyBuffer) Bytes ¶
func (b *LazyBuffer) Bytes(n int) []byte
Bytes returns a []byte that has length n. It re-uses the underlying LazyBuffer []byte if it is at least n bytes in length.
Click to show internal directories.
Click to hide internal directories.