dns

package
v0.0.0-...-6060be6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultZoneName = "local"

We don't really support multiple zone ids, but we could Also, not supporting multiple zone ids makes implementing dnsprovider painful

Variables

This section is empty.

Functions

func RunDNSUpdates

func RunDNSUpdates(target DNSTarget, src *DNSView)

Types

type DNSRecord

type DNSRecord struct {
	Name    string
	Rrdatas []string
	RrsType string
}

type DNSTarget

type DNSTarget interface {
	Update(snapshot *DNSViewSnapshot) error
}

type DNSView

type DNSView struct {
	// contains filtered or unexported fields
}

func NewDNSView

func NewDNSView(gossipState gossip.GossipState) *DNSView

func (*DNSView) AddZone

func (v *DNSView) AddZone(info DNSZoneInfo) (*DNSZoneInfo, error)

AddZone adds the specified zone; this creates a fake NS record just so that the zone has records

func (*DNSView) ApplyChangeset

func (v *DNSView) ApplyChangeset(zone DNSZoneInfo, removeRecords []*DNSRecord, createRecords []*DNSRecord) error

ApplyChangeset applies a DNS changeset to the records.

func (*DNSView) RemoveZone

func (v *DNSView) RemoveZone(info DNSZoneInfo) error

RemoveZone removes the specified zone, though this is currently not supported and returns an error.

func (*DNSView) Snapshot

func (v *DNSView) Snapshot() *DNSViewSnapshot

Snapshot returns a copy of the current desired DNS state-of-the-world

type DNSViewSnapshot

type DNSViewSnapshot struct {
	// contains filtered or unexported fields
}

func (*DNSViewSnapshot) ListZones

func (s *DNSViewSnapshot) ListZones() []DNSZoneInfo

ListZones returns all zones

func (*DNSViewSnapshot) RecordsForZone

func (s *DNSViewSnapshot) RecordsForZone(zoneInfo DNSZoneInfo) []DNSRecord

RecordsForZone returns records matching the specified zone

func (*DNSViewSnapshot) RecordsForZoneAndName

func (s *DNSViewSnapshot) RecordsForZoneAndName(zoneInfo DNSZoneInfo, name string) []DNSRecord

RecordsForZoneAndName returns records matching the specified zone and name

type DNSZoneInfo

type DNSZoneInfo struct {
	Name string
}

type HostsFile

type HostsFile struct {
	Path string
}

HostsFile stores DNS records into /etc/hosts

func (*HostsFile) Update

func (h *HostsFile) Update(snapshot *DNSViewSnapshot) error

Directories

Path Synopsis
Package provider implements a dnsprovider backed by the gossip store.
Package provider implements a dnsprovider backed by the gossip store.

Jump to

Keyboard shortcuts

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