Help us shape the future of Go! Take the 2026 Go Developer Survey

session

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package session monitors live playback sessions on a Plex Media Server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

Monitor polls a Plex Media Server for live playback sessions.

func NewMonitor

func NewMonitor(client *plex.Client, server plex.Server, interval time.Duration) *Monitor

NewMonitor creates a session monitor that polls client at interval.

Parameters:

  • client: Plex client used to query the server.
  • server: Plex Media Server to poll.
  • interval: Time between session refreshes.

Returns:

  • monitor: A monitor that has not been started.

func (*Monitor) GetSessions

func (mon *Monitor) GetSessions() []plex.Session

GetSessions returns a copy of the cached playback sessions.

Returns:

  • sessions: A clone of the current session list.

func (*Monitor) Start

func (mon *Monitor) Start()

Start begins polling for session updates.

func (*Monitor) Stop

func (mon *Monitor) Stop()

Stop ends polling and waits for the poll goroutine to exit.

func (*Monitor) Unauthorized added in v0.4.0

func (mon *Monitor) Unauthorized() bool

Unauthorized reports whether the server refused the last poll's token.

Returns:

  • refused: True until a poll succeeds again.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL