Documentation
¶
Index ¶
- Constants
- type APILibrarySections
- type APILibrarySectionsDirectory
- type APILibrarySectionsIDAll
- type APILibrarySectionsIDAllMediaContainer
- type APILibrarySectionsMediaContainer
- type APIServerCapabilities
- type APIServerCapabilitiesMediaContainer
- type APIStatusSessions
- type APIStatusSessionsMediaContainer
- type APITranscodeSessions
- type APITranscodeSessionsMediaContainer
- type Directory
- type HTTPClient
- type Library
- type Plex
- type PlexMediaServer
- type PlexMediaServerCollector
Constants ¶
View Source
const URLLibrarySections = "http://%s:%d/library/sections"
View Source
const URLLibrarySectionsIDAll = "http://%s:%d/library/sections/%s/all"
View Source
const URLServerCapabilities = "http://%s:%d/"
TODO CHANGE INSECURE - do we have to query server directly? query it through plex.tv?
View Source
const URLSessions = "http://%s:%d/status/sessions"
View Source
const URLTranscodeSessions = "http://%s:%d/transcode/sessions"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APILibrarySections ¶
type APILibrarySections struct {
MediaContainer APILibrarySectionsMediaContainer `json:"MediaContainer"`
}
API Response for /library/sections which gives the library list
type APILibrarySectionsIDAll ¶
type APILibrarySectionsIDAll struct {
MediaContainer APILibrarySectionsIDAllMediaContainer `json:"MediaContainer"`
}
API Response for /library/sections/id/all which gives the number of items by library
type APILibrarySectionsIDAllMediaContainer ¶
type APILibrarySectionsIDAllMediaContainer struct {
Size int `json:"size"`
}
type APILibrarySectionsMediaContainer ¶
type APILibrarySectionsMediaContainer struct {
Directory []APILibrarySectionsDirectory `json:"Directory"`
}
type APIServerCapabilities ¶ added in v1.0.0
type APIServerCapabilities struct {
MediaContainer APIServerCapabilitiesMediaContainer `json:"MediaContainer"`
}
API Response for / which returns server capabilities
type APIServerCapabilitiesMediaContainer ¶ added in v1.0.0
type APIServerCapabilitiesMediaContainer struct {
Version string `json:"version"`
}
type APIStatusSessions ¶
type APIStatusSessions struct {
MediaContainer APIStatusSessionsMediaContainer `json:"MediaContainer"`
}
API Response for /status/sections which give the number of current active sessions
type APIStatusSessionsMediaContainer ¶
type APIStatusSessionsMediaContainer struct {
Size int `json:"size"`
}
type APITranscodeSessions ¶
type APITranscodeSessions struct {
MediaContainer APITranscodeSessionsMediaContainer `json:"MediaContainer"`
}
API Response for /transcode/sessions which give the number of current active transcoding sessions
type APITranscodeSessionsMediaContainer ¶
type APITranscodeSessionsMediaContainer struct {
Size int `json:"size"`
}
type PlexMediaServer ¶
type PlexMediaServer struct {
Address string
Port int
Token string
HTTPClient HTTPClient
}
func (*PlexMediaServer) CurrentSessionsCount ¶
func (p *PlexMediaServer) CurrentSessionsCount() (int, error)
func (*PlexMediaServer) GetLibraries ¶
func (p *PlexMediaServer) GetLibraries() ([]Library, error)
GetLibraries returns the list of all libraries present on the Plex media object
func (*PlexMediaServer) GetTranscodeSessions ¶
func (p *PlexMediaServer) GetTranscodeSessions() (int, error)
GetTranscodeSessions returns the number of current transcoding sessions
func (*PlexMediaServer) GetVersion ¶ added in v1.0.0
func (p *PlexMediaServer) GetVersion() (string, error)
type PlexMediaServerCollector ¶
type PlexMediaServerCollector struct {
MetricsInfo *prometheus.Desc
MetricsSessions *prometheus.Desc
MetricsTranscodeSessions *prometheus.Desc
MetricsLibraries *prometheus.Desc
Server Plex
}
func NewPlexMediaServerCollector ¶
func NewPlexMediaServerCollector(server Plex) *PlexMediaServerCollector
func (*PlexMediaServerCollector) Collect ¶
func (p *PlexMediaServerCollector) Collect(ch chan<- prometheus.Metric)
func (*PlexMediaServerCollector) Describe ¶
func (p *PlexMediaServerCollector) Describe(ch chan<- *prometheus.Desc)
Click to show internal directories.
Click to hide internal directories.