kvstore

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWatcherStopped = errors.New("watcher stopped")
	ErrNotImplement   = errors.New("method not implement")
)

Functions

This section is empty.

Types

type Event

type Event struct {
	Type EventType
	Key  string
	Val  []byte
}

type EventType

type EventType int
const (
	Put EventType = iota // PUT
	Del                  // DEL
)

func (EventType) String

func (i EventType) String() string

type KV

type KV interface {
	Set(key string, val []byte, opts ...Option) error
	Get(key string, opts ...Option) ([]KVPair, error)
	Del(key string, opts ...Option) error
	Watch(opts ...Option) Watcher
	Close() error
	String() string
}

KV is the source from which config is loaded.

type KVPair

type KVPair struct {
	Key string
	Val []byte
}

type NopWatcher

type NopWatcher struct{}

func (NopWatcher) Next

func (NopWatcher) Next() ([]Event, error)

func (NopWatcher) Stop

func (NopWatcher) Stop() error

type Option

type Option func(context.Context) context.Context

type Watcher

type Watcher interface {
	Next() ([]Event, error)
	Stop() error
}

Watcher watches a source for changes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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