Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadWithArbElem ¶
ReadWithArbElem is a variant of Read that recognises an arbitrary length element by its zero length and imputes its actual length by the byte buffer size and the lengths of the fixed length fields.
For reasons of space efficiency, it is not practical to use TLVs for badger database key fields, so this will panic if there is more than one arbitrary length element.
Types ¶
type T ¶
type T struct {
Val by
}
T is an arbitrary length byte string. In any construction there can only be one with arbitrary length. Custom lengths can be created by calling New with the custom length in it, both for Read and Write operations.
func New ¶
func New(b by) (p *T)
New creates a new arb.T. This must have the expected length for the provided byte slice as this is what the Read method will aim to copy. In general this will be a bounded field, either the final or only arbitrary length field in a key.
func NewFromString ¶
func NewFromString(s st) (p *T)
func NewWithLen ¶
func NewWithLen(l no) (p *T)