Documentation
¶
Index ¶
- func AllKVsBackup() (pbFile *kk_pb_type.PBFile, err error)
- func AllKVsRestore(jsonBytes []byte) (err error)
- func GetConfig(configKey string, configStruct any) error
- func InitEtcd(endpoints []string, userName string, password string, debugMode bool) error
- func RegisterService(registration *kk_etcd_models.ServiceRegistration) error
- func ServerList(serviceName string) (serverList *kk_etcd_models.PBListServer, err error)
- func SetConfig(configKey string, configValue string) error
- func Snapshot() (pBFile *kk_pb_type.PBFile, err error)
- func SnapshotInfo(fileByte []byte) (info string, err error)
- func SnapshotRestore() (cmdStr string, err error)
- func WatchServerList(ctx context.Context, serviceName string, ...) (err error)
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
AllKVsRestore will overwrite exist kv
func GetConfig ¶
GetConfig get config from etcd and unmarshal to configStruct eg: GetConfig("go_rec_dev", &config.Config)
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 Snapshot ¶ added in v1.3.3
func Snapshot() (pBFile *kk_pb_type.PBFile, err error)
func SnapshotInfo ¶ added in v1.3.3
func SnapshotRestore ¶ added in v1.3.3
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.
Click to show internal directories.
Click to hide internal directories.