fdb

package
v0.0.0-...-8b3bc45 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIVersion

func GetAPIVersion() (int, error)

Returns the API version that has been selected through APIVersion or MustAPIVersion. If the version has already been selected, then the first value returned is the API version and the error is nil. If the API version has not yet been set, then the error will be non-nil.

func Printable

func Printable(d []byte) string

Printable returns a human readable version of a byte array. The bytes that correspond with ASCII printable characters [32-127) are passed through. Other bytes are replaced with \x followed by a two character zero-padded hex code for byte.

Types

type Key

type Key []byte

Key represents a FoundationDB key, a lexicographically-ordered sequence of bytes. Key implements the KeyConvertible interface.

func (Key) FDBKey

func (k Key) FDBKey() Key

FDBKey allows Key to (trivially) satisfy the KeyConvertible interface.

func (Key) String

func (k Key) String() string

String describes the key as a human readable string.

type KeyConvertible

type KeyConvertible interface {
	FDBKey() Key
}

A KeyConvertible can be converted to a FoundationDB Key. All functions in the FoundationDB API that address a specific key accept a KeyConvertible.

type KeySelector

type KeySelector struct {
	Key     KeyConvertible
	OrEqual bool
	Offset  int
}

KeySelector represents a description of a key in a FoundationDB database. A KeySelector may be resolved to a specific key with the GetKey method, or used as the endpoints of a SelectorRange to be used with a GetRange function.

The most common key selectors are constructed with the functions documented below. For details of how KeySelectors are specified and resolved, see https://apple.github.io/foundationdb/developer-guide.html#key-selectors.

func FirstGreaterOrEqual

func FirstGreaterOrEqual(key KeyConvertible) KeySelector

FirstGreaterOrEqual returns the KeySelector specifying the lexigraphically least key present in the database which is lexigraphically greater than or equal to the given key.

func FirstGreaterThan

func FirstGreaterThan(key KeyConvertible) KeySelector

FirstGreaterThan returns the KeySelector specifying the lexigraphically least key present in the database which is lexigraphically strictly greater than the given key.

func LastLessOrEqual

func LastLessOrEqual(key KeyConvertible) KeySelector

LastLessOrEqual returns the KeySelector specifying the lexigraphically greatest key present in the database which is lexigraphically less than or equal to the given key.

func LastLessThan

func LastLessThan(key KeyConvertible) KeySelector

LastLessThan returns the KeySelector specifying the lexigraphically greatest key present in the database which is lexigraphically strictly less than the given key.

func (KeySelector) FDBKeySelector

func (ks KeySelector) FDBKeySelector() KeySelector

type Selectable

type Selectable interface {
	FDBKeySelector() KeySelector
}

A Selectable can be converted to a FoundationDB KeySelector. All functions in the FoundationDB API that resolve a key selector to a key accept Selectable.

Directories

Path Synopsis
Package tuple provides a layer for encoding and decoding multi-element tuples into keys usable by FoundationDB.
Package tuple provides a layer for encoding and decoding multi-element tuples into keys usable by FoundationDB.

Jump to

Keyboard shortcuts

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