Documentation ¶
Overview ¶
Package discover implements the device discovery protocol.
Index ¶
- Constants
- Variables
- func Register(proto string, factory Factory)
- type Address
- type Announce
- type CacheEntry
- type Client
- 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 Factory
- type Query
- type UDPClient
Constants ¶
View Source
const ( AnnouncementMagic = 0x9D79BC39 QueryMagic = 0x2CA856F5 )
Variables ¶
View Source
var ( DefaultErrorRetryInternval = 60 * time.Second DefaultGlobalBroadcastInterval = 1800 * time.Second )
View Source
var (
ErrIncorrectMagic = errors.New("incorrect magic number")
)
Functions ¶
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 Client ¶ added in v0.10.10
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.