dns

package
v0.0.0-...-8cfe922 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package dns provides the capability to modify DNS records for swarms.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultNamingPattern = NamingPattern{
		Zone:            "example.com",
		Catchall:        "*.{{.Stack}}",
		CatchallPrivate: "*.{{.Stack}}.private",
		Public:          "{{.Stack}}",
		Private:         "{{.Stack}}.private",
		Fleet:           "{{.Stack}}.fleet",
	}
)

Functions

func CreateSwarmEntries

func CreateSwarmEntries(service DNSService, pattern NamingPattern, s *swarm.Swarm) error

CreateSwarmEntries creates DNS entries, given a NamingPattern and Swarm.

func DeleteEntries

func DeleteEntries(service DNSService, pattern NamingPattern, stackName string) error

DeleteEntries deletes DNS entries, given a NamingPattern and stack name.

func Update

func Update(service DNSService, pattern NamingPattern, s *swarm.Swarm, instances []swarmtypes.Instance) (bool, error)

Update ensures that necessary DNS records that might have changed are updated.

NOTE: This currently only checks the fleet entry. Returns false if no update was necessary.

Types

type CloudFlareConfig

type CloudFlareConfig struct {
	Email, Token string
}

CloudFlareConfig provides the static configuration for a CloudFlareDNS service.

type CloudFlareDNS

type CloudFlareDNS struct {
	CloudFlareConfig
	// contains filtered or unexported fields
}

CloudFlareDNS represents a client to the CloudFlare API.

func NewCloudFlareDNS

func NewCloudFlareDNS(config CloudFlareConfig) *CloudFlareDNS

NewCloudFlareDNS creates a new CloudFlareDNS object based on the given config. If the config is invalid, a panic will be raised.

type DNSService

type DNSService interface {
	// contains filtered or unexported methods
}

DNSService provides mangement of a swarm's DNS entries.

type Entries

type Entries struct {
	// The root domain for all entries, e.g. giantswarm.io or giantswarm.co.uk
	Zone string

	// Endpoint domains
	Catchall        string
	CatchallPrivate string
	Public          string
	Private         string
	Fleet           string
}

Entries represents a set of DNS entries.

type NamingPattern

type NamingPattern struct {
	// The name of the zone to create the domains in
	Zone string

	// Golang templates
	Catchall        string
	CatchallPrivate string
	Public          string
	Private         string
	Fleet           string
}

NamingPattern defines the template to use when generating the domain names to create. Assume the value 'Stack' can be used to reference the cluster name.

The generated domain here will always be postfixed with the zone, so this is not part of the template.

func (NamingPattern) GetEntries

func (np NamingPattern) GetEntries(stackName string) *Entries

GetEntries returns Entries, given a stack name.

type NoopDNS

type NoopDNS struct{}

NoopDNS provides a DNSService implementation that does nothing. Useful for when we don't want to set up DNS at all.

func NewNoopDNS

func NewNoopDNS() *NoopDNS

NewNoopDNS returns a new NoopDNS.

Jump to

Keyboard shortcuts

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