database/kv
kayos@tcp.direct f045593496
Docs: refresh markdown
2022-07-25 21:57:01 -07:00
..
README.md Docs: refresh markdown 2022-07-25 21:57:01 -07:00
keyvalue.go Massive overhaul 2022-07-25 21:36:46 -07:00
keyvalue_test.go Massive overhaul 2022-07-25 21:36:46 -07:00

kv

import "git.tcp.direct/tcp.direct/database/kv"

Documentation

type Key

type Key struct {}

Key represents a key in a key/value store.

func NewKey

func NewKey(data []byte) *Key

NewKey creates a new Key from a byte slice.

func (*Key) Bytes

func (k *Key) Bytes() []byte

Bytes returns the raw byte slice form of the Key.

func (*Key) Equal

func (k *Key) Equal(k2 *Key) bool

Equal determines if two keys are equal.

func (*Key) String

func (k *Key) String() string

String returns the string slice form of the Key.

type KeyValue

type KeyValue struct {
	Key   *Key
	Value *Value
}

KeyValue represents a key and a value from a key/value store.

func NewKeyValue

func NewKeyValue(k *Key, v *Value) *KeyValue

NewKeyValue creates a new KeyValue from a key and value.

func (*KeyValue) Equal

func (kv *KeyValue) Equal(kv2 *KeyValue) bool

Equal determines if two key/value pairs are equal.

func (*KeyValue) String

func (kv *KeyValue) String() string

type Value

type Value struct {}

Value represents a value in a key/value store.

func NewValue

func NewValue(data []byte) *Value

NewValue creates a new Value from a byte slice.

func (*Value) Bytes

func (v *Value) Bytes() []byte

Bytes returns the raw byte slice form of the Value.

func (*Value) Equal

func (v *Value) Equal(v2 *Value) bool

Equal determines if two values are equal.

func (*Value) String

func (v *Value) String() string

String returns the string slice form of the Value.