etcd

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateServiceKey

func GenerateServiceKey(service string) string

func WithLogger

func WithLogger(log *logrus.Logger) func(b *Backend)

func WithStaticLabels

func WithStaticLabels(labels []string) func(b *Backend)

Types

type Backend

type Backend struct {
	Name           string
	Log            *logrus.Entry
	EtcdClient     *clientv3.Client
	ForwardAddress string
	StaticLabels   []string
}

func New

func New(cfg clientv3.Config, options ...EtcdOption) (*Backend, error)

func (*Backend) GetName

func (b *Backend) GetName() string

func (*Backend) Purge

func (b *Backend) Purge() error

func (*Backend) Refresh

func (b *Backend) Refresh(containers []types.ContainerJSON) error

func (*Backend) RegisterServices

func (b *Backend) RegisterServices(ports map[string]backends.ServiceWithLabels) error

func (*Backend) Run

func (b *Backend) Run(ctx context.Context, events chan docker.ContainerEvent, purgeOnStart bool, containersToRefresh []types.ContainerJSON) error

func (*Backend) UnregisterServices

func (b *Backend) UnregisterServices(ports map[string]backends.ServiceWithLabels) error

type EtcdOption

type EtcdOption func(*Backend)

Jump to

Keyboard shortcuts

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