kvengine

package
v0.0.0-...-b83a8b2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Endp    = "127.0.0.1:2379"
	Timeout = 5 * time.Second
)
View Source
const (
	Addr   = "127.0.0.1:6379"
	Passwd = ""
)

Variables

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

Functions

func IsENotFound

func IsENotFound(err error) bool

Types

type Iterator

type Iterator interface {
	Valid() bool
	Key() string
	Value() string
	Next() error
	Close()
}

type KVEngine

type KVEngine interface {
	Close() error
	Set(key string, value []byte) error
	Get(key string) ([]byte, error)
	Delete(key string) error
}

type KVEngineEtcd

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

func NewETCDKV

func NewETCDKV() *KVEngineEtcd

func (*KVEngineEtcd) Close

func (kv *KVEngineEtcd) Close() error

func (*KVEngineEtcd) Delete

func (kv *KVEngineEtcd) Delete(key string) error

func (*KVEngineEtcd) Get

func (kv *KVEngineEtcd) Get(key string) ([]byte, error)

func (*KVEngineEtcd) Set

func (kv *KVEngineEtcd) Set(key string, value []byte) error

func (*KVEngineEtcd) Watch

func (kv *KVEngineEtcd) Watch(prefix string)

type KVEngineRedis

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

func NewRedisKV

func NewRedisKV() *KVEngineRedis

func (*KVEngineRedis) Close

func (kv *KVEngineRedis) Close() error

func (*KVEngineRedis) Delete

func (kv *KVEngineRedis) Delete(key string) error

func (*KVEngineRedis) Get

func (kv *KVEngineRedis) Get(key string) ([]byte, error)

func (*KVEngineRedis) Set

func (kv *KVEngineRedis) Set(key string, value []byte) error

Jump to

Keyboard shortcuts

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