Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (this *Config) CreatePath(path string) error
- func (this *Config) Destroy() error
- func (this *Config) EnumerateServices(local bool) []string
- func (this *Config) ExpireServices() []*rpc.ServiceRecord
- func (this *Config) ExpireTask(start chan<- event.Signal, stop <-chan event.Signal) error
- func (this *Config) GetServices(service string, local bool) []*rpc.ServiceRecord
- func (this *Config) IndexForService(service *rpc.ServiceRecord) int
- func (this *Config) Init(path string, source gopi.Driver, errors chan<- error) error
- func (this *Config) Read(path string) error
- func (this *Config) Reader(fh io.Reader) (*Config, error)
- func (this *Config) Register(service *rpc.ServiceRecord) error
- func (this *Config) Remove(service *rpc.ServiceRecord) error
- func (this *Config) RemoveAtIndex(index int) error
- func (this *Config) SetModified()
- func (this Config) String() string
- func (this *Config) Write(path string, indent bool) error
- func (this *Config) WriteConfigTask(start chan<- event.Signal, stop <-chan event.Signal) error
- func (this *Config) Writer(fh io.Writer, indent bool) error
- type Discovery
- type Listener
- func (this *Listener) AnswerEnum(name string, ttl time.Duration)
- func (this *Listener) Destroy() error
- func (this *Listener) Init(config Discovery, errors chan<- error, services chan<- *rpc.ServiceRecord, ...) error
- func (this *Listener) Query(msg *dns.Msg, ctx context.Context) error
- func (this Listener) String() string
Constants ¶
View Source
const ( FILENAME_DEFAULT = "discovery.json" WRITE_DELTA = 5 * time.Second EXPIRE_DELTA = 60 * time.Second )
View Source
const ( MDNS_DEFAULT_DOMAIN = "local." MDNS_SERVICE_QUERY = "_services._dns-sd._udp" DELTA_QUERY = 5 * time.Second )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { sync.Mutex event.Tasks event.Publisher // Public members Services []*rpc.ServiceRecord `json:"services"` // contains filtered or unexported fields }
func (*Config) CreatePath ¶
Create path if it doesn't exist
func (*Config) EnumerateServices ¶ added in v1.0.6
func (*Config) ExpireServices ¶
func (this *Config) ExpireServices() []*rpc.ServiceRecord
ExpireServices returns an array of unexpired services
func (*Config) ExpireTask ¶
func (*Config) GetServices ¶ added in v1.0.6
func (this *Config) GetServices(service string, local bool) []*rpc.ServiceRecord
func (*Config) IndexForService ¶
func (this *Config) IndexForService(service *rpc.ServiceRecord) int
func (*Config) RemoveAtIndex ¶
func (*Config) WriteConfigTask ¶
Click to show internal directories.
Click to hide internal directories.