herbdata

package module
v0.0.0-...-48f0ced Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 2 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataOrder = binary.BigEndian
View Source
var ErrEntryTooLarge = errors.New("data entry too large")

ErrEntryTooLarge error raised when data is too large to store.

View Source
var ErrInvalidatedKey = errors.New("invalidated key")

ErrInvalidatedKey error raised if given key invalidated

View Source
var ErrInvalidatedTTL = errors.New("invalidated ttl")

ErrInvalidatedTTL error raised if given key invalidated

View Source
var ErrKeyTooLarge = errors.New("data key too large")

ErrKeyTooLarge error raised when key is too large to store.

View Source
var ErrNotFlushable = errors.New("not flushable")

ErrNotFlushable error raised if not flushable

View Source
var ErrNotFound = errors.New("data not found")

ErrNotFound error raised if given key not found form key value database

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get([]byte) ([]byte, error)
	SetWithTTL(key []byte, value []byte, ttl int64) error
	Delete([]byte) error
}

type CacheServer

type CacheServer interface {
	Cache
	Server
}

type DataDecoder

type DataDecoder interface {
	DecodeData([]byte) error
}

type DataDecoderFunc

type DataDecoderFunc func([]byte) error

func (DataDecoderFunc) DecodeData

func (f DataDecoderFunc) DecodeData(data []byte) error

type DataEncoder

type DataEncoder interface {
	EncodeData() ([]byte, error)
}

type DataEncoderFunc

type DataEncoderFunc func() ([]byte, error)

func (DataEncoderFunc) EncodeData

func (f DataEncoderFunc) EncodeData() ([]byte, error)

type DataEncoding

type DataEncoding interface {
	DataMarshaler
	DataUnmarshaler
}

type DataMarshaler

type DataMarshaler interface {
	MarshalData(interface{}) ([]byte, error)
}

type DataUnmarshaler

type DataUnmarshaler interface {
	UnmarshalData([]byte, interface{}) error
}

type Deleter

type Deleter interface {
	Delete([]byte) error
}

type ExpiredSetter

type ExpiredSetter interface {
	Set([]byte, []byte) error
	SetWithExpired(key []byte, value []byte, expired int64) error
}

type ExpiredSetterDeleter

type ExpiredSetterDeleter interface {
	Set([]byte, []byte) error
	SetWithExpired(key []byte, value []byte, expired int64) error
	Delete([]byte) error
}

type FlushableCache

type FlushableCache interface {
	Flush() error
	Cache
}

type Getter

type Getter interface {
	Get([]byte) ([]byte, error)
}

type KeyValue

type KeyValue struct {
	Key   []byte
	Value []byte
}

func (*KeyValue) Clone

func (k *KeyValue) Clone() *KeyValue

type Server

type Server interface {
	Start() error
	Stop() error
}

type Setter

type Setter interface {
	Set([]byte, []byte) error
}

type SetterDeleter

type SetterDeleter interface {
	Set([]byte, []byte) error
	Delete([]byte) error
}

type SetterGetter

type SetterGetter interface {
	Setter
	Getter
}

type SetterGetterServer

type SetterGetterServer interface {
	Setter
	Getter
	Server
}

type Store

type Store interface {
	Set([]byte, []byte) error
	Get([]byte) ([]byte, error)
	Delete([]byte) error
}

type StoreServer

type StoreServer interface {
	Store
	Server
}

Jump to

Keyboard shortcuts

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