Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Port is the sd01 service discovery port number.
Port = 17823
)
Variables ¶
View Source
var ( // Interval between announcements. Interval = 5 * time.Second )
these vars may be overridden by test
View Source
var ( // Timeout after which a discovered service is considered non-existent. // Defined by protocol. Timeout = 600 * time.Second )
these vars may be overridden by test
Functions ¶
This section is empty.
Types ¶
type Announcer ¶
type Announcer struct {
// contains filtered or unexported fields
}
Announcer implements sd01 service announcement.
func NewAnnouncer ¶
NewAnnouncer returns a new Announcer and published beacons containing the supplied service name and port number.
type Discoverer ¶
type Discoverer struct { Debug bool // contains filtered or unexported fields }
Discoverer implements sd01 service discovery and provides a list of recently discovered services.
func NewDiscoverer ¶
func NewDiscoverer(name string) *Discoverer
NewDiscoverer returns a new Discoverer with name as the service filter. Matching service discoveries will be reported via the GetServices method
func (*Discoverer) GetServices ¶
func (d *Discoverer) GetServices() []Service
GetServices returns a list of recently discovered services.
func (*Discoverer) Start ¶
func (d *Discoverer) Start() error
Start the Discoverer. Remember to call Stop when finished.
Click to show internal directories.
Click to hide internal directories.