kk_etcd

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-3-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllKVsBackup added in v1.3.3

func AllKVsBackup() (pbFile *kk_pb_type.PBFile, err error)

func AllKVsRestore added in v1.3.3

func AllKVsRestore(jsonBytes []byte) (err error)

AllKVsRestore will overwrite exist kv

func GetConfig

func GetConfig(configKey string, configStruct any) error

GetConfig get config from etcd and unmarshal to configStruct eg: GetConfig("go_rec_dev", &config.Config)

func InitEtcd

func InitEtcd(endpoints []string, userName string, password string, debugMode bool) error

func RegisterService added in v1.3.0

func RegisterService(registration *kk_etcd_models.ServiceRegistration) error

RegisterService register service to etcd

func ServerList added in v1.3.0

func ServerList(serviceName string) (serverList *kk_etcd_models.PBListServer, err error)

ServerList serviceName, should with prefix key_prefix.ServiceGrpc or key_prefix.ServiceHttp only give prefix to get all service list

func SetConfig added in v1.3.3

func SetConfig(configKey string, configValue string) error

SetConfig set config to etcd

func Snapshot added in v1.3.3

func Snapshot() (pBFile *kk_pb_type.PBFile, err error)

func SnapshotInfo added in v1.3.3

func SnapshotInfo(fileByte []byte) (info string, err error)

func SnapshotRestore added in v1.3.3

func SnapshotRestore() (cmdStr string, err error)

func WatchServerList added in v1.3.2

func WatchServerList(ctx context.Context, serviceName string, serverListChan chan *kk_etcd_models.PBListServer) (err error)

WatchServerList watch server list change

Types

This section is empty.

Jump to

Keyboard shortcuts

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