etcdclient

package
v0.0.0-...-3ddb297 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(econf *ETCDConfigs) (err error)

Types

type ETCDClient

type ETCDClient struct {
	// contains filtered or unexported fields
}

func Get

func Get() *ETCDClient

func (*ETCDClient) AddEndpoints

func (ec *ETCDClient) AddEndpoints(ctx context.Context, service string, address string) (err error)

func (*ETCDClient) Close

func (ec *ETCDClient) Close() (err error)

func (*ETCDClient) GetServices

func (ec *ETCDClient) GetServices(ctx context.Context, servicePrefix string) (services []*Service, err error)

func (*ETCDClient) GetValueByKey

func (ec *ETCDClient) GetValueByKey(ctx context.Context, key string) (val []string, err error)

func (*ETCDClient) RemoveEndpoints

func (ec *ETCDClient) RemoveEndpoints(ctx context.Context, service string, address string) (err error)

func (*ETCDClient) Resolver

func (ec *ETCDClient) Resolver() *etcdnaming.GRPCResolver

func (*ETCDClient) SaveKeyValue

func (ec *ETCDClient) SaveKeyValue(ctx context.Context, key string, val string) (err error)

type ETCDConfigs

type ETCDConfigs struct {
	Endpoints []string `mapstructure:"endpoints"`
	Timeout   int      `mapstructure:"timeout"`
}

type Service

type Service struct {
	Name string `json:"-"`
	Addr string `json:"addr"`
}

Jump to

Keyboard shortcuts

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