backends

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MPL-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StoreClient

type StoreClient interface {
	Client() *zk.Conn
	GetValues(keys []string) (map[string]string, error)
	WatchPrefix(keys []string, waitIndex uint64, stopChan chan bool) (uint64, error)
	Lock(path string) *zk.Lock
	Add(path string, value []byte, flags int32) (string, error)
	Modify(path string, value []byte) error
	Delete(path string) error
}

The StoreClient interface is implemented by objects that can retrieve key/value pairs from a backend store.

func New

func New(conf StoreConfig) (StoreClient, error)

New is used to create a storage client based on our configuration.

func NewMock

func NewMock(conf StoreConfig) (StoreClient, error)

type StoreConfig

type StoreConfig struct {
	Backend      string            `json:"backend"`      // 后端服务地址
	Username     string            `json:"username"`     // 只读用户名
	Password     string            `json:"password"`     // 只读用户密码
	OpenUser     string            `json:"openUser"`     // 可读写用户名
	OpenPassword string            `json:"openPassword"` // 可读写密码
	Exp          map[string]string `json:"exp"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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