key

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultDelimiter = "_"

DefaultDelimiter represents the default delimiter used for the KV store keys when concatenating them together

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key interface {
	Append(Key) Key
	Bytes() []byte
	String() string
}

Key provides a type safe way to interact with the store

func From added in v0.27.0

func From(key fmt.Stringer) Key

From creates a new Key from a fmt.Stringer interface Deprecated: use FromHashed instead

func FromBz

func FromBz(key []byte) Key

FromBz creates a new Key from bytes Deprecated: use FromBzHashed instead

func FromBzHashed added in v0.31.0

func FromBzHashed(key []byte) Key

FromBzHashed creates a new Key from bytes

func FromHashed added in v0.31.0

func FromHashed(key fmt.Stringer) Key

FromHashed creates a new Key from a fmt.Stringer interface

func FromStr

func FromStr(key string) Key

FromStr creates a new Key from a string Deprecated: use FromStrHashed instead

func FromStrHashed added in v0.31.0

func FromStrHashed(key string) Key

FromStrHashed creates a new Key from a string

func FromUInt

func FromUInt[T constraints.Unsigned](key T) Key

FromUInt creates a new Key from any unsigned integer type

func RegisterStaticKey added in v0.31.0

func RegisterStaticKey(namespace string, prefix uint) Key

RegisterStaticKey registers a static key particle for the data store to ensure uniqueness per namespace. Panics if two prefixes with the same value for the same namespace are registered.

Jump to

Keyboard shortcuts

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