mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
24 lines
442 B
Go
24 lines
442 B
Go
|
package networkdb
|
||
|
|
||
|
import "github.com/hashicorp/memberlist"
|
||
|
|
||
|
type eventDelegate struct {
|
||
|
nDB *NetworkDB
|
||
|
}
|
||
|
|
||
|
func (e *eventDelegate) NotifyJoin(n *memberlist.Node) {
|
||
|
e.nDB.Lock()
|
||
|
e.nDB.nodes[n.Name] = n
|
||
|
e.nDB.Unlock()
|
||
|
}
|
||
|
|
||
|
func (e *eventDelegate) NotifyLeave(n *memberlist.Node) {
|
||
|
e.nDB.deleteNodeTableEntries(n.Name)
|
||
|
e.nDB.Lock()
|
||
|
delete(e.nDB.nodes, n.Name)
|
||
|
e.nDB.Unlock()
|
||
|
}
|
||
|
|
||
|
func (e *eventDelegate) NotifyUpdate(n *memberlist.Node) {
|
||
|
}
|