Documentation ¶
Index ¶
Constants ¶
View Source
const Header = "<?xml version=\"1.0\" standalone='no'?><!--*-nxml-*-->\n<!DOCTYPE service-group SYSTEM \"avahi-service.dtd\">\n"
Variables ¶
This section is empty.
Functions ¶
func Write ¶
func Write(sg ServiceGroup, path string) error
Types ¶
type Service ¶
type Service struct { XMLName xml.Name `xml:"service"` Protocol string `xml:"protocol,attr"` // (ipv4|ipv6|any) default: "any" Type string `xml:"type"` Subtypes []Subtype `xml:"subtype,omitempty"` DomainName string `xml:"domain-name,omitempty"` HostName string `xml:"host-name,omitempty"` Port string `xml:"port"` TxtRecords []TxtRecord `xml:"txt-record,omitempty"` }
type ServiceGroup ¶
type ServiceGroup struct { XMLName xml.Name `xml:"service-group"` Name Name Services []Service `xml:"service"` }
func NewServiceGroup ¶
func NewServiceGroup(name string, nameReplaceWildcards bool, services []Service) (ServiceGroup, error)
func Read ¶
func Read(path string) (ServiceGroup, error)
type Subtype ¶
func NewSubtype ¶
type TxtRecord ¶
type TxtRecord struct { XMLName xml.Name `xml:"txt-record"` ValueFormat string `xml:"value-format,attr"` // (text|binary-hex|binary-base64) default: "text" Value string `xml:",chardata"` }
func NewTxtRecord ¶
func NewTxtRecord(value string, valueFormat ValueFormat) (TxtRecord, error)
type ValueFormat ¶
type ValueFormat = string
const ( ValueFormatText ValueFormat = "text" ValueFormatBinaryHex ValueFormat = "binary-hex" ValueFormatBinaryBase64 ValueFormat = "binary-base64" )
Click to show internal directories.
Click to hide internal directories.