kv

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 1 Imported by: 0

README

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

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 {
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

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