listener

package
v0.0.0-...-c19e6b2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrInitDockerClient error code for problems while creating the Docker Client
	ErrInitDockerClient = iota

	// ErrInitHookClient error code for problems while creating the Hook Client
	ErrInitHookClient = iota

	// ErrTalkToDocker error code for problems while communicating with docker
	ErrTalkToDocker = iota

	// ErrReadingTags error code for problems while reading the BINDMAN_DNS_TAGS environment variable
	ErrReadingTags = iota

	// ErrReadingReverseProxyAddress error code for problems while reading the BINDMAN_REVERSE_PROXY_ADDRESS environment variable
	ErrReadingReverseProxyAddress = iota

	// ErrListingServicesForSync error code for problems when listing the swarm services for syncing
	ErrListingServicesForSync = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SandmanService

type SandmanService struct {
	ServiceName string
	HostName    string
	Tags        []string
}

SandmanService groups together the service name, the host name and the tags

type SwarmListener

type SwarmListener struct {
	DockerClient  *docker.Client
	WebhookClient *hook.DNSWebhookClient

	ReverseProxyAddress string
	Tags                []string
	SyncLock            *sync.RWMutex
	// contains filtered or unexported fields
}

SwarmListener owns a Docker Client and a Hook Client

func New

func New(httpHelper hook.HTTPHelper) *SwarmListener

New instantiates a new swarm listener

func (*SwarmListener) Listen

func (sl *SwarmListener) Listen()

Listen prepares the ground to listen to docker events

func (*SwarmListener) Sync

func (sl *SwarmListener) Sync()

Sync defines a routine for syncing the dns records present in the docker swarm and being managed by the bindman dns manager

Jump to

Keyboard shortcuts

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