kv

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseObject   = HeaderType('D')
	CollectionObject = HeaderType('C')
	DocumentObject   = HeaderType('O')
	IndexObject      = HeaderType('I')
)
View Source
const (
	PrimaryIndex   = IndexType(1)
	SecondaryIndex = IndexType(2)
)
View Source
const (
	CBOR = DocumentType(1)
)
View Source
const (
	V1 = Version(1)
)

Variables

View Source
var CollectionKeyHeader = [2]byte{byte(CollectionObject), byte(byte(CBOR) | HeaderByteFromVersion(V1))}

Functions

func HeaderByteFromVersion

func HeaderByteFromVersion(v Version) byte

func TypeFromHeaderByte

func TypeFromHeaderByte(b byte) byte

Types

type DocumentType

type DocumentType byte

DocumentType represents a document type.

type HeaderType

type HeaderType byte

type IndexType

type IndexType byte

IndexType represents an index type.

type Key

type Key = document.Key

Key represents an object key.

func NewKeyWith

func NewKeyWith(header KeyHeader, key Key) Key

NewKeyWith returns a new key from the specified header and key elements.

type KeyHeader

type KeyHeader [2]byte

KeyHeader represents a header for all keys.

func NewKeyHeaderFrom

func NewKeyHeaderFrom(b []byte) KeyHeader

NewKeyHeader creates a new key header from the specified bytes.

func (KeyHeader) Bytes

func (header KeyHeader) Bytes() []byte

Bytes returns a byte array.

func (KeyHeader) DocumentType

func (header KeyHeader) DocumentType() DocumentType

DocumentType returns a document type.

func (KeyHeader) IndexType

func (header KeyHeader) IndexType() IndexType

IndexType returns an index type.

func (KeyHeader) String

func (header KeyHeader) String() string

String returns a string.

func (KeyHeader) Type

func (header KeyHeader) Type() HeaderType

Type returns a header type.

func (KeyHeader) Version

func (header KeyHeader) Version() Version

Version returns a version.

type Version

type Version byte

Version represents a version.

func VertionFromHeaderByte

func VertionFromHeaderByte(b byte) Version

Jump to

Keyboard shortcuts

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