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

watchparty

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package watchparty is the shared room both Silo Watch Party and Jellyfin SyncPlay speak. One title, one timeline. Each member still opens their own playback session, so the broker keeps their transcode and stream limit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine is safe for concurrent clients.

func New

func New(opts Options) *Engine

New returns an empty engine.

func (*Engine) Create

func (*Engine) End

func (e *Engine) End(_ context.Context, actor frontend.PartyActor, roomID, token string) error

func (*Engine) Get

func (e *Engine) Get(_ context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyView, error)

func (*Engine) IssueTicket

func (e *Engine) IssueTicket(_ context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyTicket, error)

func (*Engine) Join

func (*Engine) Leave

func (e *Engine) Leave(_ context.Context, actor frontend.PartyActor) error

func (*Engine) List

func (*Engine) OpenSocket

func (e *Engine) OpenSocket(_ context.Context, roomID, raw string) (frontend.PartySocket, error)

func (*Engine) Policy

func (e *Engine) Policy(_ context.Context, actor frontend.PartyActor, roomID, token, policy string) (frontend.PartyView, error)

func (*Engine) Queue

func (e *Engine) Queue(ctx context.Context, actor frontend.PartyActor, op frontend.PartyQueue) error

func (*Engine) Report

func (e *Engine) Report(ctx context.Context, actor frontend.PartyActor, msg frontend.PartyReport) error

func (*Engine) Select

func (e *Engine) Select(ctx context.Context, actor frontend.PartyActor, roomID, token string, pick frontend.PartyPick) (frontend.PartyView, error)

func (*Engine) Start

func (e *Engine) Start(ctx context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyView, error)

func (*Engine) Stop

func (e *Engine) Stop(_ context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyView, error)

func (*Engine) Subscribe

func (e *Engine) Subscribe(actor frontend.PartyActor) (<-chan frontend.PartyEvent, func())

func (*Engine) Transport

func (e *Engine) Transport(ctx context.Context, actor frontend.PartyActor, roomID, token string, in frontend.PartyInput) error

type Options

type Options struct {
	Now     func() time.Time
	Lead    time.Duration
	UseLead bool
	// Allow reports whether this viewer may know the title exists.
	// Any error denies the party operation and the title is not returned.
	Allow func(context.Context, frontend.Protocol, *core.Viewer, core.RatingKey) error
	// Streams reports whether this member may open another play of the title.
	// core.ErrStreamLimit blocks that member without stopping the others,
	// unless the member who asked for playback is the one over the limit.
	// Callers receive frontend.ErrPartyForbidden for that refusal.
	Streams func(context.Context, frontend.Protocol, *core.Viewer, core.Device, core.RatingKey) error
	// ItemID and JellyfinUser render protocol ids. Nil uses a decimal form.
	ItemID       func(core.RatingKey) string
	JellyfinUser func(int64) string
}

Options configures access checks and the clock. Tests pass a fake clock.

Jump to

Keyboard shortcuts

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