keys

package
v0.0.0-...-2627f95 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b Key) int

Compare compares two keys -1 means a < b 1 means a > b 0 means a = b

func Int64ToKey

func Int64ToKey(i int64) [8]byte

Int64ToKey constructs a key from an int64

func KeyToInt64

func KeyToInt64(k [8]byte) int64

KeyToInt64 constructs an int64 from a byte array

Types

type Key

type Key []byte

Key is a single key

func Inc

func Inc(key Key) Key

Inc increments the key

func Next

func Next(key Key) Key

type Range

type Range struct {
	Min []byte
	Max []byte
	// contains filtered or unexported fields
}

Range represents all keys such that

k >= Min and k < Max

If Min = nil that indicates the start of all keys If Max = nil that indicatese the end of all keys If multiple modifiers are called on a range the end result is effectively the same as ANDing all the restrictions.

func All

func All() Range

All returns a new key range matching all keys

func (Range) Contains

func (r Range) Contains(key Key) bool

Contains returns true if the range contains key

func (Range) Eq

func (r Range) Eq(k []byte) Range

Eq confines the range to just key k

func (Range) Gt

func (r Range) Gt(k []byte) Range

Gt confines the range to keys that are greater than k

func (Range) Gte

func (r Range) Gte(k []byte) Range

Gte confines the range to keys that are greater than or equal to k

func (Range) Lt

func (r Range) Lt(k []byte) Range

Lt confines the range to keys that are less than k

func (Range) Lte

func (r Range) Lte(k []byte) Range

Lte confines the range to keys that are less than or equal to k

func (Range) Namespace

func (r Range) Namespace(ns []byte) Range

Namespace namespaces keys in the range with to keys with the prefix ns. Subsequent modifier methods will keep keys within this namespace.

func (Range) Prefix

func (r Range) Prefix(k []byte) Range

Prefix confines the range to keys that have the prefix k, excluding k itself

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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