Documentation ¶
Index ¶
Constants ¶
View Source
const ErrorPinNotAuthorized = "Pin not authorized"
View Source
const LibraryURI = "%s/library/sections"
View Source
const SectionURI = "%s/library/sections/%d/all"
View Source
const ServerInfoURI = "%s/media/providers"
View Source
const StatusURI = "%s/status/sessions"
View Source
const TestURI = "%s/identity"
Variables ¶
This section is empty.
Functions ¶
func GetTokenFromPinRequest ¶
func GetTokenFromPinRequest(p *PinRequest) (string, error)
GetTokenFromPinRequest takes in a PinRequest and checks if it has been authenticated. If it has been authenticated it returns the token. If it has not been authenticated it returns an empty string.
Types ¶
type LibraryMetric ¶
type PinRequest ¶
type PinRequest struct {
Pin `json:"pin"`
}
func GetPinRequest ¶
func GetPinRequest() (*PinRequest, error)
GetPinRequest creates a PinRequest using the Plex API and returns it.
type PlexClient ¶
type PlexClient struct { Logger *log.Entry Servers []*Server // contains filtered or unexported fields }
func NewPlexClient ¶
func NewPlexClient(c *config.PlexConfig, l *log.Entry) (*PlexClient, error)
func (*PlexClient) GetServerMetrics ¶
func (c *PlexClient) GetServerMetrics() map[string]ServerMetric
GetServerMetrics fetches all metrics for each server and returns them in a map with the servers' names as keys.
type Server ¶
type Server struct { ID string Name string Version string Platform string BaseURL string // contains filtered or unexported fields }
func (*Server) GetLibrary ¶
func (s *Server) GetLibrary() (*api.LibraryResponse, error)
func (*Server) GetServerInfo ¶ added in v0.2.3
func (s *Server) GetServerInfo() (*api.ServerInfoResponse, error)
func (*Server) GetSessionCount ¶
type ServerMetric ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.