Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation []byte
Annotation represents information used to annotate datapoints.
type Segment ¶
type Segment struct { // Head is the head of the segment. Head checked.Bytes // Tail is the tail of the segment. Tail checked.Bytes // SegmentFlags declares whether to finalize when finalizing the segment. Flags SegmentFlags }
Segment represents a binary blob consisting of two byte slices and declares whether they should be finalized when the segment is finalized.
func NewSegment ¶
func NewSegment( head, tail checked.Bytes, flags SegmentFlags, ) Segment
NewSegment will create a new segment and increment the refs to head and tail if they are non-nil. When finalized the segment will also finalize the byte slices if FinalizeBytes is passed.
func (*Segment) Equal ¶
Equal returns if this segment is equal to another. WARNING: This should only be used in code paths not executed often as it allocates bytes to concat each segment head and tail together before comparing the contents.
type SegmentFlags ¶
type SegmentFlags uint8
SegmentFlags describes the option to finalize or not finalize bytes in a Segment.
const ( // FinalizeNone specifies to finalize neither of the bytes FinalizeNone SegmentFlags = 1 << 0 // FinalizeHead specifies to finalize the head bytes FinalizeHead SegmentFlags = 1 << 1 // FinalizeTail specifies to finalize the tail bytes FinalizeTail SegmentFlags = 1 << 2 )