Documentation ¶
Overview ¶
Package discover implements the device discovery protocol.
Index ¶
- Constants
- Variables
- type Address
- type Announce
- type CacheEntry
- type Device
- type Discoverer
- func (d *Discoverer) All() map[protocol.DeviceID][]CacheEntry
- func (d *Discoverer) ExtAnnounceOK() map[string]bool
- func (d *Discoverer) Hint(device string, addrs []string)
- func (d *Discoverer) Lookup(device protocol.DeviceID) []string
- func (d *Discoverer) StartGlobal(servers []string, extPort uint16)
- func (d *Discoverer) StartLocal(localPort int, localMCAddr string)
- func (d *Discoverer) StopGlobal()
- 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 Address ¶
func (Address) MarshalXDR ¶
func (Address) MustMarshalXDR ¶ added in v0.10.3
func (*Address) UnmarshalXDR ¶
type Announce ¶
func (Announce) MarshalXDR ¶
func (Announce) MustMarshalXDR ¶ added in v0.10.3
func (*Announce) UnmarshalXDR ¶
type CacheEntry ¶ added in v0.10.2
type Device ¶ added in v0.10.0
func (Device) MarshalXDR ¶ added in v0.10.0
func (Device) MustMarshalXDR ¶ added in v0.10.3
func (*Device) UnmarshalXDR ¶ added in v0.10.0
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
func NewDiscoverer ¶
func NewDiscoverer(id protocol.DeviceID, addresses []string) *Discoverer
func (*Discoverer) All ¶
func (d *Discoverer) All() map[protocol.DeviceID][]CacheEntry
func (*Discoverer) ExtAnnounceOK ¶
func (d *Discoverer) ExtAnnounceOK() map[string]bool
func (*Discoverer) Hint ¶
func (d *Discoverer) Hint(device string, addrs []string)
func (*Discoverer) StartGlobal ¶
func (d *Discoverer) StartGlobal(servers []string, extPort uint16)
func (*Discoverer) StartLocal ¶
func (d *Discoverer) StartLocal(localPort int, localMCAddr string)
func (*Discoverer) StopGlobal ¶
func (d *Discoverer) StopGlobal()
type Query ¶
func (Query) MarshalXDR ¶
func (Query) MustMarshalXDR ¶ added in v0.10.3
func (*Query) UnmarshalXDR ¶
Click to show internal directories.
Click to hide internal directories.