Moved updater into server

While we're only reacting to containers going away, it's more
convenient to bundle the docker events watcher into the server.

I've added a flag to switch it on; and switched it on by default in
the container.

I also implemented `Zone.DeleteRecordsFor(ident)`, which removes all
records for a particular container.

One minor change to the structure of the code is that the Zone is now
constructed *outside* the server, and given to it and the updater.
This commit is contained in:
Michael Bridgen committed 2014-10-16 15:38:32 +01:00
1 parent 0fb4bce24d
commit 0749460652
9 files changed
+102 -72

No files matched your search

+2 -2
View File
@@ -9,10 +9,10 @@ import (
type MDNSServer struct {
localAddrs []net.Addr
sendconn *net.UDPConn
zone *ZoneDb
zone Zone
}
func NewMDNSServer(zone *ZoneDb) (*MDNSServer, error) {
func NewMDNSServer(zone Zone) (*MDNSServer, error) {
//log.Println("minimalServer sending:", buf)
// This is a bit of a kludge - per the RFC we should send responses from 5353, but that doesn't seem to work
sendconn, err := net.ListenUDP("udp4", &net.UDPAddr{IP: net.IPv4zero, Port: 0})