Documentation ¶
Index ¶
- Constants
- Variables
- func NewEvent(source gopi.Unit, type_ gopi.RPCEventType, service gopi.RPCServiceRecord, ...) gopi.RPCEvent
- func NewService(zone string) *service
- func NewTokenizer(src string) *tokenizer
- func Quote(src string) string
- func Unquote(src string) (string, error)
- type Database
- func (this *Database) Close()
- func (this *Database) DeleteName(name string) bool
- func (this *Database) DeleteRecord(key string) bool
- func (this *Database) ExistsName(name string) bool
- func (this *Database) Init()
- func (this *Database) Names() []string
- func (this *Database) Records(srv string) []gopi.RPCServiceRecord
- func (this *Database) RegisterName(r *event) gopi.RPCEvent
- func (this *Database) RegisterRecord(r *event) gopi.RPCEvent
- func (this *Database) SetName(name string, expires time.Time) bool
- func (this *Database) SetRecord(key string, srv gopi.RPCServiceRecord, expires time.Time) (bool, bool)
- type Discovery
- type Listener
- type ListenerIface
- type Record
- type Register
- type ServiceDB
Constants ¶
View Source
const ( DISCOVERY_SERVICE_QUERY = "_services._dns-sd._udp" MDNS_DEFAULT_DOMAIN = "local." MDNS_DEFAULT_TTL = 120 DISCOVERY_LOOKUP_DELTA = 5 * time.Second QUERY_REPEAT = 2 // Number of times to repeat a message DELTA_QUERY_MS = 500 // Maximum time to wait between repeats // Pulisher queue numbers QUEUE_MESSAGES = 0 QUEUE_ERRORS = 1 QUEUE_NAME = 2 QUEUE_RECORD = 3 )
View Source
const (
EOF rune = -(iota + 1)
)
Variables ¶
View Source
var ( MULTICAST_ADDR_IPV4 = &net.UDPAddr{IP: net.ParseIP("224.0.0.251"), Port: 5353} MULTICAST_ADDR_IPV6 = &net.UDPAddr{IP: net.ParseIP("ff02::fb"), Port: 5353} )
View Source
var (
ErrParseError = errors.New("Parse Error")
)
Functions ¶
func NewService ¶
func NewService(zone string) *service
func NewTokenizer ¶
func NewTokenizer(src string) *tokenizer
Types ¶
type Database ¶ added in v2.0.19
Database represents the current state of mDNS, service names and records
func (*Database) DeleteName ¶ added in v2.0.19
DeleteName and return true if the name previously existed
func (*Database) DeleteRecord ¶ added in v2.0.19
DeleteRecord and return true if the name previously existed
func (*Database) ExistsName ¶ added in v2.0.19
ExistsName returns true if name exists and isn't expired
func (*Database) Records ¶ added in v2.0.19
func (this *Database) Records(srv string) []gopi.RPCServiceRecord
Return all unexpired records that match a service
func (*Database) RegisterName ¶ added in v2.0.19
func (*Database) RegisterRecord ¶ added in v2.0.19
type Discovery ¶
type Discovery struct {
Listener ListenerIface
}
type ListenerIface ¶
type Register ¶
type Register struct {
Listener ListenerIface
}
Click to show internal directories.
Click to hide internal directories.