binding

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package binding holds the selected Plex Media Server and session monitor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

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

Binding holds the process-wide Plex server selection and live sessions.

func New

func New(product, clientID string, interval time.Duration) *Binding

New creates a binding that polls sessions at the given interval.

Parameters:

  • product: Plex product name sent with API requests.
  • clientID: Plex client identifier.
  • interval: Session poll interval.

Returns:

  • binding: A ready-to-use server binding.

func (*Binding) Clear

func (bind *Binding) Clear()

Clear drops the selected server and stops session monitoring.

func (*Binding) Get

func (bind *Binding) Get() (plex.Server, bool)

Get returns the selected server.

Returns:

  • server: The currently selected Plex server.
  • ok: True when a server has been selected.

func (*Binding) Sessions

func (bind *Binding) Sessions() []plex.Session

Sessions returns the latest cached playback sessions.

Returns:

  • sessions: A copy of the current session list.

func (*Binding) Set

func (bind *Binding) Set(server plex.Server)

Set selects a Plex server and starts session monitoring.

Parameters:

  • server: The Plex Media Server to bind to.

func (*Binding) Stop

func (bind *Binding) Stop()

Stop ends session monitoring.

Jump to

Keyboard shortcuts

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