etcdconfig

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Service        = "/kelvins-service"
	DefaultCluster = "cluster"
)

Variables

View Source
var ErrServiceConfigKeyNotExist = errors.New("service config key not exist")

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceVersion string `json:"service_version"`
	ServicePort    string `json:"service_port"`
	ServiceIP      string `json:"service_ip"`
	ServiceKind    string `json:"service_kind"`
	LastModified   string `json:"last_modified"`
}

type ServiceConfigClient added in v1.4.2

type ServiceConfigClient struct {
	ServiceLB *slb.ServiceLB
	Config
}

func NewServiceConfigClient added in v1.4.2

func NewServiceConfigClient(slb *slb.ServiceLB) *ServiceConfigClient

func (*ServiceConfigClient) ClearConfig added in v1.4.2

func (s *ServiceConfigClient) ClearConfig(sequence string) error

func (*ServiceConfigClient) GetConfig added in v1.4.2

func (s *ServiceConfigClient) GetConfig(sequence string) (*Config, error)

func (*ServiceConfigClient) GetConfigs added in v1.4.2

func (s *ServiceConfigClient) GetConfigs() (map[string]*Config, error)

func (*ServiceConfigClient) GetKeyName added in v1.4.2

func (s *ServiceConfigClient) GetKeyName(serverName string, sequences ...string) string

GetKeyName etcd key cannot end with a number

func (*ServiceConfigClient) ListConfigs added in v1.4.2

func (s *ServiceConfigClient) ListConfigs() (map[string]*Config, error)

func (*ServiceConfigClient) Watch added in v1.6.0

func (s *ServiceConfigClient) Watch(ctx context.Context) (<-chan struct{}, error)

func (*ServiceConfigClient) WriteConfig added in v1.4.2

func (s *ServiceConfigClient) WriteConfig(sequence string, c Config) error

Jump to

Keyboard shortcuts

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