Documentation ¶
Overview ¶
Package lansrv: These functions are built to work with systemd.
Index ¶
- Constants
- Variables
- func GatherServiceConfigs(dir string) (configFiles []string)
- func ServicesLookup(ctx context.Context, localhost bool) (map[string][]LanAd, error)
- func StartMdnsServer(ads []LanAd, port int) (*zeroconf.Server, error)
- type Broadcast
- type Discover
- type LanAd
- type LanAdFormatPart
- type LanAdsDiscovery
- type ZeroConfActor
Constants ¶
View Source
const ( Protocol LanAdFormatPart = marker + "pro" + marker Address = marker + "addr" + marker Port = marker + "port" + marker Path = marker + "path" + marker AdService = marker + "svc" + marker )
Variables ¶
View Source
var Service = "LanSrv"
Functions ¶
func GatherServiceConfigs ¶
GatherServiceConfigs accepts @arg dir which it will walk recusively and collect an array of file names that contain a lansrv config. Lansrv is built to work with systemd so any file ending with `.service` will be included in the array.
func ServicesLookup ¶
ServicesLookup returns a map containing hostnames along with a list of LanAds published on that host.
Types ¶
type LanAd ¶
func ParseServiceFiles ¶
ParseServiceConfigs takes @arg configs (list of filenames), tries to parse them as ini files and returns all non-nil results for lansrv configurations containing at least a Name and a Port.
func (*LanAd) FromString ¶
FromString takes a string formatted {{protocol}}://{{service name}}:{{port}}/{{path}}
func (*LanAd) ToFormattedString ¶ added in v1.1.0
type LanAdFormatPart ¶ added in v1.1.0
type LanAdFormatPart = string
type LanAdsDiscovery ¶ added in v1.2.0
type ZeroConfActor ¶ added in v1.2.0
type ZeroConfActor struct { Ads []LanAd // contains filtered or unexported fields }
func (*ZeroConfActor) Receive ¶ added in v1.2.0
func (state *ZeroConfActor) Receive(actorCtx actor.Context)
Click to show internal directories.
Click to hide internal directories.