Documentation ¶
Overview ¶
Package discover implements the node discovery protocol.
Index ¶
- Constants
- Variables
- type Address
- type Announce
- type Discoverer
- func (d *Discoverer) All() map[protocol.NodeID][]cacheEntry
- func (d *Discoverer) ExtAnnounceOK() bool
- func (d *Discoverer) Hint(node string, addrs []string)
- func (d *Discoverer) Lookup(node protocol.NodeID) []string
- func (d *Discoverer) StartGlobal(server string, extPort uint16)
- func (d *Discoverer) StartLocal(localPort int, localMCAddr string)
- func (d *Discoverer) StopGlobal()
- type Node
- type Query
Constants ¶
View Source
const ( AnnouncementMagic = 0x9D79BC39 QueryMagic = 0x2CA856F5 )
Variables ¶
View Source
var (
ErrIncorrectMagic = errors.New("incorrect magic number")
)
Functions ¶
This section is empty.
Types ¶
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
func NewDiscoverer ¶
func NewDiscoverer(id protocol.NodeID, addresses []string) *Discoverer
func (*Discoverer) All ¶
func (d *Discoverer) All() map[protocol.NodeID][]cacheEntry
func (*Discoverer) ExtAnnounceOK ¶
func (d *Discoverer) ExtAnnounceOK() bool
func (*Discoverer) Hint ¶
func (d *Discoverer) Hint(node string, addrs []string)
func (*Discoverer) StartGlobal ¶
func (d *Discoverer) StartGlobal(server string, extPort uint16)
func (*Discoverer) StartLocal ¶
func (d *Discoverer) StartLocal(localPort int, localMCAddr string)
func (*Discoverer) StopGlobal ¶
func (d *Discoverer) StopGlobal()
Click to show internal directories.
Click to hide internal directories.