etcd

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 13 Imported by: 0

README

docker

docker run -p 2379:2379 --name etcd quay.io/coreos/etcd:v3.1.0 /usr/local/bin/etcd --advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379 --initial-advertise-peer-urls http://0.0.0.0:2380 --listen-peer-urls http://0.0.0.0:2380
docker exec -it etcd bin/sh

export ETCDCTL_API=3

etcdctl get /public/yuanboot_demo_dev/8ca0e6c8-1896-4fdc-a775-ab565a84f166

etcdctl version

etcdctl version: 3.1.0
API version: 3
etcdctl role add root
etcdctl user add root
etcdctl user  grant-role  root root
etcdctl auth enable

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerDiscovery

func NewServerDiscovery(option Config) servicediscovery.IServiceDiscovery

func UseServiceDiscovery

func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)

Types

type Auth

type Auth struct {
	Enable   bool   `mapstructure:"enable" config:"enable"`
	User     string `mapstructure:"username" config:"username"`
	Password string `mapstructure:"password" config:"password"`
}

type Config

type Config struct {
	ENV       *abstractions.HostEnvironment
	Address   []string `mapstructure:"address" config:"address"`
	Namespace string   `mapstructure:"namespace" config:"namespace"`
	Ttl       int64    `mapstructure:"ttl" config:"ttl"`
	Auth      *Auth    `mapstructure:"auth" config:"auth"`
}

type Registrar

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

func (*Registrar) Destroy

func (r *Registrar) Destroy() error

func (*Registrar) GetAllInstances

func (r *Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance

func (*Registrar) GetAllServices

func (r *Registrar) GetAllServices() ([]*servicediscovery.Service, error)

func (*Registrar) GetHealthyInstances

func (r *Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance

func (*Registrar) GetName

func (r *Registrar) GetName() string

func (*Registrar) Register

func (r *Registrar) Register() error

func (*Registrar) Unregister

func (r *Registrar) Unregister() error

func (*Registrar) Update

func (r *Registrar) Update() error

func (*Registrar) Watch

type Watcher

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

func (*Watcher) Next

func (w *Watcher) Next() (*servicediscovery.Result, error)

func (*Watcher) Stop

func (w *Watcher) Stop()

Jump to

Keyboard shortcuts

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