Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddUserResponse ¶
type AvahiRegistrar ¶ added in v0.7.0
type AvahiRegistrar struct {
// contains filtered or unexported fields
}
AvahiRegistrar implements ServiceRegistrar using avahi-daemon via D-Bus. This allows go-librespot to share the mDNS responder with other services on the system instead of running its own.
Compatibility: Requires avahi-daemon 0.6.x or later (uses stable D-Bus API). Tested with avahi 0.7 and 0.8.
func NewAvahiRegistrar ¶ added in v0.7.0
func NewAvahiRegistrar() (*AvahiRegistrar, error)
NewAvahiRegistrar creates a new avahi-daemon service registrar. It connects to the system D-Bus and prepares to register services via avahi.
func (*AvahiRegistrar) Register ¶ added in v0.7.0
func (a *AvahiRegistrar) Register(name, serviceType, domain string, port int, txt []string) error
Register publishes the service via avahi-daemon.
func (*AvahiRegistrar) Shutdown ¶ added in v0.7.0
func (a *AvahiRegistrar) Shutdown()
Shutdown removes the service from avahi and releases resources.
func (*AvahiRegistrar) Version ¶ added in v0.7.0
func (a *AvahiRegistrar) Version() string
Version returns the avahi-daemon version string.
type BuiltinRegistrar ¶ added in v0.7.0
type BuiltinRegistrar struct {
// contains filtered or unexported fields
}
BuiltinRegistrar implements ServiceRegistrar using the grandcat/zeroconf library, which provides a pure-Go mDNS responder.
func NewBuiltinRegistrar ¶ added in v0.7.0
func NewBuiltinRegistrar(ifaces []net.Interface) *BuiltinRegistrar
NewBuiltinRegistrar creates a new built-in mDNS service registrar. If ifaces is empty, the service will be advertised on all interfaces.
func (*BuiltinRegistrar) Register ¶ added in v0.7.0
func (b *BuiltinRegistrar) Register(name, serviceType, domain string, port int, txt []string) error
Register publishes the service using the built-in mDNS responder.
func (*BuiltinRegistrar) Shutdown ¶ added in v0.7.0
func (b *BuiltinRegistrar) Shutdown()
Shutdown stops the mDNS responder.
type GetInfoResponse ¶
type GetInfoResponse struct {
Status int `json:"status"`
StatusString string `json:"statusString"`
SpotifyError int `json:"spotifyError"`
Version string `json:"version"`
LibraryVersion string `json:"libraryVersion"`
AccountReq string `json:"accountReq"`
BrandDisplayName string `json:"brandDisplayName"`
ModelDisplayName string `json:"modelDisplayName"`
VoiceSupport string `json:"voiceSupport"`
Availability string `json:"availability"`
ProductID int `json:"productID"`
TokenType string `json:"tokenType"`
GroupStatus string `json:"groupStatus"`
ResolverVersion string `json:"resolverVersion"`
Scope string `json:"scope"`
DeviceID string `json:"deviceID"`
RemoteName string `json:"remoteName"`
PublicKey string `json:"publicKey"`
DeviceType string `json:"deviceType"`
ActiveUser string `json:"activeUser"`
}
type HandleNewRequestFunc ¶
type HandleNewRequestFunc func(req NewUserRequest) bool
type NewUserRequest ¶
type ServiceRegistrar ¶ added in v0.7.0
type ServiceRegistrar interface {
// Register publishes the service via mDNS.
// name: service instance name (e.g., "go-librespot")
// serviceType: service type (e.g., "_spotify-connect._tcp")
// domain: domain to register in (e.g., "local.")
// port: TCP port the service is listening on
// txt: TXT record key=value pairs
Register(name, serviceType, domain string, port int, txt []string) error
// Shutdown stops advertising the service and releases resources.
Shutdown()
}
ServiceRegistrar handles mDNS service registration. Implementations can use different backends like built-in mDNS or avahi-daemon.
type Zeroconf ¶
type Zeroconf struct {
// contains filtered or unexported fields
}
func NewZeroconf ¶
func (*Zeroconf) Close ¶
func (z *Zeroconf) Close()
Close stops the zeroconf responder and HTTP listener, but does not close the last opened session.
func (*Zeroconf) Serve ¶
func (z *Zeroconf) Serve(handler HandleNewRequestFunc) error