v0.0.14 Latest Latest

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 6



Package config wraps the dnslb and associated plugin packages and creates a DNS load balancer based on configuration data.



This section is empty.


This section is empty.


func Block added in v0.0.5

func Block(config Config, ip string, duration time.Duration,
	cancelChannel <-chan struct{}, logger log.DebugLogger) error

Block will block a server instance with the specified IP address from adding itself to DNS for the specified time or until a message is received on cancelChannel.

func New

func New(config Config, logger log.DebugLogger) (*dnslb.LoadBalancer, error)

New creates a *dnslb.LoadBalancer using the provided configuration and back-end DNS provider. This will launch a goroutine to perform periodic health checks for the peer servers and to self register.

func RollingReplace added in v0.0.5

func RollingReplace(config Config, region string,
	logger log.DebugLogger) error

RollingReplace will use the provided configuration and will roll through all server instances in the specified region triggering replacements by removing each server from DNS, destroying it and waiting for (some other mechanism) to create a working replacement before continuing to the next server.


type Config

type Config struct {
	AllRegions          bool   `yaml:"all_regions"`
	AwsAssumeRoleArn    string `yaml:"aws_assume_role_arn"`
	AwsProfile          string `yaml:"aws_profile"`
	dnslb.Config        `yaml:",inline"`
	Preserve            bool   `yaml:"preserve"`
	Route53HostedZoneId string `yaml:"route53_hosted_zone_id"`

func (Config) Check

func (c Config) Check() (bool, error)

Check returns true if the configuration has a single DNS back-end provider specified, else it returns false. An error is returned if the configuration is malformed (i.e. multiple DNS back-end providers specified).

Jump to

Keyboard shortcuts

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