Documentation ¶
Overview ¶
Package discover implements the device discovery protocol.
Index ¶
- Constants
- Variables
- func Register(proto string, factory Factory)
- type Address
- func (o Address) AppendXDR(bs []byte) ([]byte, error)
- func (o *Address) DecodeXDR(r io.Reader) error
- func (o *Address) DecodeXDRFrom(xr *xdr.Reader) error
- func (o Address) EncodeXDR(w io.Writer) (int, error)
- func (o Address) EncodeXDRInto(xw *xdr.Writer) (int, error)
- func (o Address) MarshalXDR() ([]byte, error)
- func (o Address) MustMarshalXDR() []byte
- func (o *Address) UnmarshalXDR(bs []byte) error
- type Announce
- func (o Announce) AppendXDR(bs []byte) ([]byte, error)
- func (o *Announce) DecodeXDR(r io.Reader) error
- func (o *Announce) DecodeXDRFrom(xr *xdr.Reader) error
- func (o Announce) EncodeXDR(w io.Writer) (int, error)
- func (o Announce) EncodeXDRInto(xw *xdr.Writer) (int, error)
- func (o Announce) MarshalXDR() ([]byte, error)
- func (o Announce) MustMarshalXDR() []byte
- func (o *Announce) UnmarshalXDR(bs []byte) error
- type CacheEntry
- type Client
- type Device
- func (o Device) AppendXDR(bs []byte) ([]byte, error)
- func (o *Device) DecodeXDR(r io.Reader) error
- func (o *Device) DecodeXDRFrom(xr *xdr.Reader) error
- func (o Device) EncodeXDR(w io.Writer) (int, error)
- func (o Device) EncodeXDRInto(xw *xdr.Writer) (int, error)
- func (o Device) MarshalXDR() ([]byte, error)
- func (o Device) MustMarshalXDR() []byte
- func (o *Device) UnmarshalXDR(bs []byte) error
- 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
- func (o Query) AppendXDR(bs []byte) ([]byte, error)
- func (o *Query) DecodeXDR(r io.Reader) error
- func (o *Query) DecodeXDRFrom(xr *xdr.Reader) error
- func (o Query) EncodeXDR(w io.Writer) (int, error)
- func (o Query) EncodeXDRInto(xw *xdr.Writer) (int, error)
- func (o Query) MarshalXDR() ([]byte, error)
- func (o Query) MustMarshalXDR() []byte
- func (o *Query) UnmarshalXDR(bs []byte) error
- 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) DecodeXDRFrom ¶ added in v0.11.0
func (Address) EncodeXDRInto ¶ added in v0.11.0
func (Address) MarshalXDR ¶
func (Address) MustMarshalXDR ¶ added in v0.10.3
func (*Address) UnmarshalXDR ¶
type Announce ¶
func (*Announce) DecodeXDRFrom ¶ added in v0.11.0
func (Announce) EncodeXDRInto ¶ added in v0.11.0
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) DecodeXDRFrom ¶ added in v0.11.0
func (Device) EncodeXDRInto ¶ added in v0.11.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) EncodeXDRInto ¶ added in v0.11.0
func (Query) MarshalXDR ¶
func (Query) MustMarshalXDR ¶ added in v0.10.3
func (*Query) UnmarshalXDR ¶
Click to show internal directories.
Click to hide internal directories.