Documentation ¶
Overview ¶
Package node implements link.Node and link.Peer interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WithDefault = func(n *Node) { l, e := net.Listen("tcp", "127.0.0.1:0") if e != nil { log.Fatalf("net.Listen tcp :0: %v", e) } n.listener = l n.addr = l.Addr() }
WithDefault can be used to instantiate a new node with default options.
Functions ¶
func WithAddr ¶
WithAddr sets the address when instantiating a new node (e.g. New(WithAddr(...), ...)).
func WithID ¶
WithID sets the ID when instantiating a new node (e.g. New(WithID("identifier"), ...)).
func WithListener ¶
WithListener sets the listener when instantiate a new node.
Types ¶
type Node ¶
type Node struct { *Peer // contains filtered or unexported fields }
Node represents a node in the cluster with its peers.
Click to show internal directories.
Click to hide internal directories.