nameserver

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2017 License: Apache-2.0 Imports: 18 Imported by: 14

Documentation

Index

Constants

View Source
const (
	DefaultListenAddress = "0.0.0.0:53"
	DefaultTTL           = 1
	DefaultClientTimeout = 5 * time.Second
)
View Source
const (

	// Used by prog/weaver/main.go and proxy/create_container_interceptor.go
	DefaultDomain = "weave.local."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CaseInsensitive added in v1.2.0

type CaseInsensitive Entries

func (CaseInsensitive) Get added in v1.2.0

func (es CaseInsensitive) Get(i int) Entry

func (CaseInsensitive) Len added in v1.2.0

func (es CaseInsensitive) Len() int

... but we store entries in a case insensitive order.

func (CaseInsensitive) Less added in v1.2.0

func (es CaseInsensitive) Less(i, j int) bool

func (CaseInsensitive) Swap added in v1.2.0

func (es CaseInsensitive) Swap(i, j int)

type CaseSensitive added in v1.2.0

type CaseSensitive Entries

func (CaseSensitive) Get added in v1.2.0

func (es CaseSensitive) Get(i int) Entry

func (CaseSensitive) Len added in v1.2.0

func (es CaseSensitive) Len() int

Gossip messages are sorted in a case sensitive order...

func (CaseSensitive) Less added in v1.2.0

func (es CaseSensitive) Less(i, j int) bool

func (CaseSensitive) Swap added in v1.2.0

func (es CaseSensitive) Swap(i, j int)

type DNSServer added in v0.10.0

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

func NewDNSServer added in v0.10.0

func NewDNSServer(ns *Nameserver, domain, address string, upstream Upstream, ttl uint32, clientTimeout time.Duration) (*DNSServer, error)

func (*DNSServer) ActivateAndServe added in v1.0.0

func (d *DNSServer) ActivateAndServe()

func (*DNSServer) Stop added in v0.10.0

func (d *DNSServer) Stop() error

func (*DNSServer) String added in v1.1.0

func (d *DNSServer) String() string

type Entries added in v1.1.0

type Entries []Entry

type Entry added in v1.1.0

type Entry struct {
	ContainerID string
	Origin      mesh.PeerName
	Addr        address.Address
	Hostname    string // as supplied

	Version   int
	Tombstone int64 // timestamp of when it was deleted
	// contains filtered or unexported fields
}

func (*Entry) String added in v1.1.0

func (e1 *Entry) String() string

type EntryStatus added in v1.1.0

type EntryStatus struct {
	Hostname    string
	Origin      string
	ContainerID string
	Address     string
	Version     int
	Tombstone   int64
}

type GossipData added in v1.1.0

type GossipData struct {
	Timestamp int64
	Entries
}

func (*GossipData) Decode added in v1.2.1

func (g *GossipData) Decode(msg []byte) error

func (*GossipData) Encode added in v1.1.0

func (g *GossipData) Encode() [][]byte

func (*GossipData) Merge added in v1.1.0

type Nameserver added in v1.1.0

type Nameserver struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Nameserver: gossip-based, in memory nameserver. - Holds a sorted list of (hostname, peer, container id, ip) tuples for the whole cluster. - This list is gossiped & merged around the cluser. - Lookup-by-hostname are O(nlogn), and return a (copy of a) slice of the entries - Update is O(n) for now

func New added in v1.1.0

func New(ourName mesh.PeerName, domain string, isKnownPeer func(mesh.PeerName) bool) *Nameserver

func (*Nameserver) AddEntry added in v1.1.0

func (n *Nameserver) AddEntry(hostname, containerid string, origin mesh.PeerName, addr address.Address)

func (*Nameserver) AddEntryFQDN

func (n *Nameserver) AddEntryFQDN(fqdn, containerid string, origin mesh.PeerName, addr address.Address)

func (*Nameserver) ContainerDestroyed added in v1.5.0

func (n *Nameserver) ContainerDestroyed(ident string)

func (*Nameserver) ContainerDied added in v1.1.0

func (n *Nameserver) ContainerDied(ident string)

func (*Nameserver) ContainerStarted added in v1.2.0

func (n *Nameserver) ContainerStarted(ident string)

func (*Nameserver) Delete added in v1.1.0

func (n *Nameserver) Delete(hostname, containerid, ipStr string, ip address.Address)

func (*Nameserver) Gossip added in v1.1.0

func (n *Nameserver) Gossip() mesh.GossipData

func (*Nameserver) HandleHTTP added in v1.1.0

func (n *Nameserver) HandleHTTP(router *mux.Router, dockerCli *docker.Client)

func (*Nameserver) Lookup added in v1.1.0

func (n *Nameserver) Lookup(hostname string) []address.Address

func (*Nameserver) OnGossip added in v1.1.0

func (n *Nameserver) OnGossip(msg []byte) (mesh.GossipData, error)

merge received data into state and return "everything new I've just learnt", or nil if nothing in the received data was new

func (*Nameserver) OnGossipBroadcast added in v1.1.0

func (n *Nameserver) OnGossipBroadcast(_ mesh.PeerName, msg []byte) (mesh.GossipData, error)

merge received data into state and return a representation of the received data, for further propagation

func (*Nameserver) OnGossipUnicast added in v1.1.0

func (n *Nameserver) OnGossipUnicast(sender mesh.PeerName, msg []byte) error

func (*Nameserver) PeerGone added in v1.1.0

func (n *Nameserver) PeerGone(peer mesh.PeerName)

func (*Nameserver) ReverseLookup added in v1.1.0

func (n *Nameserver) ReverseLookup(ip address.Address) (string, error)

func (*Nameserver) SetGossip added in v1.1.0

func (n *Nameserver) SetGossip(gossip mesh.Gossip)

func (*Nameserver) Start added in v1.1.0

func (n *Nameserver) Start()

func (*Nameserver) Stop added in v1.1.0

func (n *Nameserver) Stop()

type SortableEntries added in v1.2.0

type SortableEntries interface {
	sort.Interface
	Get(i int) Entry
}

type Status added in v1.1.0

type Status struct {
	Domain   string
	Upstream []string
	Address  string
	TTL      uint32
	Entries  []EntryStatus
}

func NewStatus added in v1.1.0

func NewStatus(ns *Nameserver, dnsServer *DNSServer) *Status

type Upstream added in v1.6.0

type Upstream interface {
	Config() (*dns.ClientConfig, error)
}

func NewUpstream added in v1.6.0

func NewUpstream(resolvConf, filterAddress string) Upstream

Jump to

Keyboard shortcuts

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