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 ¶
- type Engine
- func (e *Engine) Create(ctx context.Context, actor frontend.PartyActor, req frontend.PartyCreate) (frontend.PartyView, error)
- func (e *Engine) End(_ context.Context, actor frontend.PartyActor, roomID, token string) error
- func (e *Engine) Get(_ context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyView, error)
- func (e *Engine) IssueTicket(_ context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyTicket, error)
- func (e *Engine) Join(ctx context.Context, actor frontend.PartyActor, req frontend.PartyJoin) (frontend.PartyView, error)
- func (e *Engine) Leave(_ context.Context, actor frontend.PartyActor) error
- func (e *Engine) List(_ context.Context, actor frontend.PartyActor) []frontend.PartyView
- func (e *Engine) OpenSocket(_ context.Context, roomID, raw string) (frontend.PartySocket, error)
- func (e *Engine) Policy(_ context.Context, actor frontend.PartyActor, roomID, token, policy string) (frontend.PartyView, error)
- func (e *Engine) Queue(ctx context.Context, actor frontend.PartyActor, op frontend.PartyQueue) error
- func (e *Engine) Report(ctx context.Context, actor frontend.PartyActor, msg frontend.PartyReport) error
- func (e *Engine) Select(ctx context.Context, actor frontend.PartyActor, roomID, token string, ...) (frontend.PartyView, error)
- func (e *Engine) Start(ctx context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyView, error)
- func (e *Engine) Stop(_ context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyView, error)
- func (e *Engine) Subscribe(actor frontend.PartyActor) (<-chan frontend.PartyEvent, func())
- func (e *Engine) Transport(ctx context.Context, actor frontend.PartyActor, roomID, token string, ...) error
- type Options
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 (*Engine) Create ¶
func (e *Engine) Create(ctx context.Context, actor frontend.PartyActor, req frontend.PartyCreate) (frontend.PartyView, error)
func (*Engine) IssueTicket ¶
func (e *Engine) IssueTicket(_ context.Context, actor frontend.PartyActor, roomID, token string) (frontend.PartyTicket, error)
func (*Engine) OpenSocket ¶
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) Subscribe ¶
func (e *Engine) Subscribe(actor frontend.PartyActor) (<-chan frontend.PartyEvent, func())
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.
Click to show internal directories.
Click to hide internal directories.