consul

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 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
	ConsulClient   *consulapi.Client
	ForwardAddress string
	StaticLabels   []string
}

func New

func New(cfg *consulapi.Config, options ...ConsulOption) (*Backend, error)

func (*Backend) DeregisterServices

func (b *Backend) DeregisterServices(ports map[string]backends.ServiceWithLabels) 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

functen that registgers ports to consul

func (*Backend) Run

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

type ConsulOption

type ConsulOption func(*Backend)

Jump to

Keyboard shortcuts

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