segment

package
v0.0.0-...-a6bde1d Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	Number int
	Type   RecordType
	Offset int
}

A Record is a pointer to a record stored in a segment.

type RecordType

type RecordType int

A RecordType is a type of a record.

const (
	// RecordTypeMapLeaf is the type of a map leaf.
	RecordTypeMapLeaf RecordType = iota
	// RecordTypeMapBranch is the type of a map branch.
	RecordTypeMapBranch
	// RecordTypeListBucket is the type of a list bucket.
	RecordTypeListBucket
	// RecordTypeList is a list, it points to a list bucket.
	RecordTypeList
	// RecordTypeValue is the type of a simple value record
	RecordTypeValue
	// RecordTypeBlock the type of a block record.
	RecordTypeBlock
	// RecordTypeTemplate is the type of a node template record.
	RecordTypeTemplate
	// RecordTypeNode is the type of a node record.
	RecordTypeNode
	// RecordTypeBlobID is the type of a binary object identifier.
	RecordTypeBlobID
)

type Reference

type Reference struct {
	Msb uint64
	Lsb uint64
}

A Reference represents a link towards another segment.

type Segment

type Segment struct {
	Version        int
	Generation     int
	FullGeneration int
	Compacted      bool
	References     []Reference
	Records        []Record
}

A Segment is a container for records.

func (*Segment) ReadFrom

func (segment *Segment) ReadFrom(reader io.Reader) (int64, error)

ReadFrom reads the content of the segment from a 'reader'. It returns the number of bytes read and an optional error.

Jump to

Keyboard shortcuts

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