nameserver

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: Apache-2.0 Imports: 17 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 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, effectiveAddress string, 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

func (Entries) Len added in v1.1.0

func (es Entries) Len() int

func (Entries) Less added in v1.1.0

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

func (Entries) Swap added in v1.1.0

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

type Entry added in v1.1.0

type Entry struct {
	ContainerID string
	Origin      router.PeerName
	Addr        address.Address
	Hostname    string
	Version     int
	Tombstone   int64 // timestamp of when it was deleted
}

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) Encode added in v1.1.0

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

func (*GossipData) Merge added in v1.1.0

func (g *GossipData) Merge(o router.GossipData)

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 router.PeerName, peers *router.Peers, docker *docker.Client, domain string) *Nameserver

func (*Nameserver) AddEntry added in v1.1.0

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

func (*Nameserver) ContainerDied added in v1.1.0

func (n *Nameserver) ContainerDied(ident string)

func (*Nameserver) Delete added in v1.1.0

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

func (*Nameserver) Gossip added in v1.1.0

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

func (*Nameserver) HandleHTTP added in v1.1.0

func (n *Nameserver) HandleHTTP(router *mux.Router)

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) (router.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(_ router.PeerName, msg []byte) (router.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 router.PeerName, msg []byte) error

func (*Nameserver) PeerGone added in v1.1.0

func (n *Nameserver) PeerGone(peer *router.Peer)

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 router.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 Status added in v1.1.0

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

func NewStatus added in v1.1.0

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

Jump to

Keyboard shortcuts

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