Documentation
¶
Index ¶
- Constants
- func BaseURL(r *http.Request) string
- func DeviceUDN(deviceID string) string
- type ChannelsProvider
- type Config
- type DiscoverResponse
- type Handler
- func (h *Handler) ConnectionManagerControl(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ConnectionManagerSCPDXML(w http.ResponseWriter, _ *http.Request)
- func (h *Handler) ContentDirectoryControl(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ContentDirectorySCPDXML(w http.ResponseWriter, _ *http.Request)
- func (h *Handler) DeviceDescriptionXML(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DiscoverJSON(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LineupHTML(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LineupJSON(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LineupM3U(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LineupStatusJSON(w http.ResponseWriter, _ *http.Request)
- func (h *Handler) LineupXML(w http.ResponseWriter, r *http.Request)
- func (h *Handler) RegisterRoutes(mux *http.ServeMux)
- func (h *Handler) SetDiscoveryAdvertisedTunerCount(tunerCount int)
- type LineupEntry
- type LineupStatusResponse
- type LineupXMLResponse
- type UPnPDeviceDescription
- type UPnPRootDescription
- type UPnPServiceDescription
- type UPnPSpecVersion
Constants ¶
View Source
const ( // UPnPDescriptionPath is the primary device XML location advertised in SSDP LOCATION. UPnPDescriptionPath = "/upnp/device.xml" // UPnPDescriptionAliasPath is a compatibility alias used by some controllers. UPnPDescriptionAliasPath = "/device.xml" // SSDP/UPnP search targets supported by the compatibility profile. UPnPSearchTargetRootDevice = "upnp:rootdevice" UPnPDeviceTypeMediaServer = "urn:schemas-upnp-org:device:MediaServer:1" UPnPDeviceTypeBasic = "urn:schemas-upnp-org:device:Basic:1" // UPnPDeviceTypeATSCPrimary is an HDHomeRun-oriented compatibility target used by some control points. UPnPDeviceTypeATSCPrimary = "urn:schemas-atsc.org:device:primaryDevice:1.0" UPnPServiceTypeConnection = "urn:schemas-upnp-org:service:ConnectionManager:1" UPnPServiceTypeContentDir = "urn:schemas-upnp-org:service:ContentDirectory:1" UPnPConnectionSCPDPath = "/upnp/scpd/connection-manager.xml" UPnPContentDirectorySCPDPath = "/upnp/scpd/content-directory.xml" UPnPConnectionControlPath = "/upnp/control/connection-manager" UPnPContentDirectoryControlPath = "/upnp/control/content-directory" UPnPConnectionEventPath = "/upnp/event/connection-manager" UPnPContentDirectoryEventPath = "/upnp/event/content-directory" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChannelsProvider ¶
ChannelsProvider provides enabled published channels for lineup responses.
type Config ¶
type Config struct {
FriendlyName string
DeviceID string
DeviceAuth string
TunerCount int
// ContentDirectoryUpdateIDCacheTTL controls how long GetSystemUpdateID values are cached.
ContentDirectoryUpdateIDCacheTTL time.Duration
}
Config carries static values used by HDHomeRun emulation handlers.
type DiscoverResponse ¶
type DiscoverResponse struct {
FriendlyName string `json:"FriendlyName"`
DeviceID string `json:"DeviceID"`
DeviceAuth string `json:"DeviceAuth"`
BaseURL string `json:"BaseURL"`
LineupURL string `json:"LineupURL"`
ModelNumber string `json:"ModelNumber"`
FirmwareName string `json:"FirmwareName"`
FirmwareVersion string `json:"FirmwareVersion"`
TunerCount int `json:"TunerCount"`
}
DiscoverResponse describes emulator metadata exposed at /discover.json.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves HDHomeRun-compatible HTTP endpoints.
func NewHandler ¶
func NewHandler(cfg Config, channelsProvider ChannelsProvider) *Handler
func (*Handler) ConnectionManagerControl ¶
func (h *Handler) ConnectionManagerControl(w http.ResponseWriter, r *http.Request)
func (*Handler) ConnectionManagerSCPDXML ¶
func (h *Handler) ConnectionManagerSCPDXML(w http.ResponseWriter, _ *http.Request)
func (*Handler) ContentDirectoryControl ¶
func (h *Handler) ContentDirectoryControl(w http.ResponseWriter, r *http.Request)
func (*Handler) ContentDirectorySCPDXML ¶
func (h *Handler) ContentDirectorySCPDXML(w http.ResponseWriter, _ *http.Request)
func (*Handler) DeviceDescriptionXML ¶
func (h *Handler) DeviceDescriptionXML(w http.ResponseWriter, r *http.Request)
func (*Handler) DiscoverJSON ¶
func (h *Handler) DiscoverJSON(w http.ResponseWriter, r *http.Request)
func (*Handler) LineupHTML ¶
func (h *Handler) LineupHTML(w http.ResponseWriter, r *http.Request)
func (*Handler) LineupJSON ¶
func (h *Handler) LineupJSON(w http.ResponseWriter, r *http.Request)
func (*Handler) LineupStatusJSON ¶
func (h *Handler) LineupStatusJSON(w http.ResponseWriter, _ *http.Request)
func (*Handler) RegisterRoutes ¶
func (*Handler) SetDiscoveryAdvertisedTunerCount ¶ added in v1.1.0
SetDiscoveryAdvertisedTunerCount updates the tuner count exposed by /discover.json. Values are capped to HDHomeRun-compatible bounds [1,255].
type LineupEntry ¶
type LineupEntry struct {
GuideNumber string `json:"GuideNumber" xml:"GuideNumber"`
GuideName string `json:"GuideName" xml:"GuideName"`
URL string `json:"URL" xml:"URL"`
Favorite int `json:"Favorite,omitempty" xml:"Favorite,omitempty"`
Subscribed int `json:"Subscribed,omitempty" xml:"Subscribed,omitempty"`
VideoCodec string `json:"VideoCodec,omitempty" xml:"VideoCodec,omitempty"`
AudioCodec string `json:"AudioCodec,omitempty" xml:"AudioCodec,omitempty"`
HD int `json:"HD" xml:"HD"`
DRM int `json:"DRM" xml:"DRM"`
}
LineupEntry is a channel record in lineup responses.
type LineupStatusResponse ¶
type LineupStatusResponse struct {
ScanInProgress int `json:"ScanInProgress"`
ScanPossible int `json:"ScanPossible"`
Source string `json:"Source"`
SourceList []string `json:"SourceList"`
}
LineupStatusResponse is a compatibility stub for scan status polling.
type LineupXMLResponse ¶
type LineupXMLResponse struct {
XMLName xml.Name `xml:"Lineup"`
Items []LineupEntry `xml:"Program"`
}
LineupXMLResponse is the /lineup.xml payload.
type UPnPDeviceDescription ¶
type UPnPDeviceDescription struct {
DeviceType string `xml:"deviceType"`
FriendlyName string `xml:"friendlyName"`
Manufacturer string `xml:"manufacturer"`
ModelName string `xml:"modelName"`
ModelNumber string `xml:"modelNumber"`
SerialNumber string `xml:"serialNumber,omitempty"`
UDN string `xml:"UDN"`
PresentationURL string `xml:"presentationURL,omitempty"`
ServiceList []UPnPServiceDescription `xml:"serviceList>service,omitempty"`
}
type UPnPRootDescription ¶
type UPnPRootDescription struct {
XMLName xml.Name `xml:"root"`
XMLNS string `xml:"xmlns,attr"`
Spec UPnPSpecVersion `xml:"specVersion"`
URLBase string `xml:"URLBase,omitempty"`
Device UPnPDeviceDescription `xml:"device"`
}
type UPnPServiceDescription ¶
type UPnPSpecVersion ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.