kv

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Zlib Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Delete = 1
	Put    = 2
)

Cmd=

Variables

This section is empty.

Functions

This section is empty.

Types

type Changed added in v0.2.3

type Changed struct {
	D   Data
	Cmd int
}

func NewChanged added in v0.2.3

func NewChanged(key, value string, cmd int) Changed

type Config

type Config interface {
	Set(data Data) error
	Get(key Key) ([]*Data, error)
}

type Data

type Data struct {
	Key
	Value string //json format
}

type Key

type Key struct {
	Path    string
	Service string
}

Key * 一个KEY 值是由路径+服务名称组合

func NewKey

func NewKey(key string) Key

func (Key) ToKey

func (n Key) ToKey() string

type WatchChan

type WatchChan chan Changed

type Watcher

type Watcher interface {
	Watcher(key Key) (WatchChan, error)
	Changed(cmd Changed)
}

Jump to

Keyboard shortcuts

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