Documentation
¶
Index ¶
- Constants
- Variables
- func NewDiscovery(c <-chan message, e chan<- event) (*discovery, error)
- func NewListener(domain, iface string, c chan<- message) (*listener, error)
- func NewServiceDatabase() *servicedb
- func NewTokenizer(src string) *tokenizer
- func Quote(src string) string
- func ReadServiceDatabase(v string) (*servicedb, error)
- func Unquote(src string) (string, error)
- type Config
- type EventType
- type Server
- func (this Server) Changed(v *Service) bool
- func (this Server) Delete(v *Service)
- func (this *Server) EnumerateInstances(ctx context.Context, services ...string) ([]*Service, error)
- func (this *Server) EnumerateServices(ctx context.Context) ([]string, error)
- func (this Server) Exists(v *Service) *Service
- func (this Server) Get(name string) *Service
- func (this Server) Instances() []*Service
- func (this Server) Lookup(service string) ServiceDescription
- func (this *Server) LookupServiceDescription(v string) ServiceDescription
- func (this Server) Query(ctx context.Context, msg *dns.Msg, iface int) error
- func (this Server) Read(v string) error
- func (this *Server) Run(ctx context.Context) error
- func (this Server) Send(msg *dns.Msg, ifIndex int) error
- func (this Server) Set(v *Service)
- func (this *Server) String() string
- type Service
- func (this *Service) Addrs() []net.IP
- func (this *Service) Equals(other *Service) bool
- func (this *Service) Host() string
- func (this *Service) Instance() string
- func (this *Service) Keys() []string
- func (s *Service) MarshalJSON() ([]byte, error)
- func (this *Service) Name() string
- func (this *Service) Port() uint16
- func (this *Service) Service() string
- func (this *Service) Txt() []string
- func (this *Service) ValueForKey(key string) string
- func (this *Service) Zone() string
- type ServiceDescription
Constants ¶
View Source
const ( ServicesQuery = "_services._dns-sd._udp" DefaultTTL = 60 * 5 // In seconds (5 mins) )
View Source
const (
DefaultServiceDatabase = "https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml"
)
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 NewDiscovery ¶
func NewDiscovery(c <-chan message, e chan<- event) (*discovery, error)
func NewListener ¶
func NewServiceDatabase ¶
func NewServiceDatabase() *servicedb
func NewTokenizer ¶
func NewTokenizer(src string) *tokenizer
func ReadServiceDatabase ¶
Types ¶
type EventType ¶
type EventType int
const ( EVENT_TYPE_ADDED EventType = (1 << iota) EVENT_TYPE_REMOVED EVENT_TYPE_EXPIRED EVENT_TYPE_CHANGED EVENT_TYPE_SERVICE EVENT_TYPE_NONE EventType = 0 EVENT_TYPE_MIN = EVENT_TYPE_ADDED EVENT_TYPE_MAX = EVENT_TYPE_SERVICE )
func (EventType) FlagString ¶
type Server ¶
type Server struct { C chan Event // Channel for emitting events // contains filtered or unexported fields }
func (*Server) EnumerateInstances ¶
func (*Server) EnumerateServices ¶
func (Server) Instances ¶
func (this Server) Instances() []*Service
Instances returns service instances
func (*Server) LookupServiceDescription ¶
func (this *Server) LookupServiceDescription(v string) ServiceDescription
Return a service description for the given service name
type Service ¶ added in v1.0.46
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) MarshalJSON ¶ added in v1.0.46
func (*Service) ValueForKey ¶ added in v1.0.46
ValueForKey return value for a key in the TXT record, or empty string if not found
Click to show internal directories.
Click to hide internal directories.