remote

package
v2.17.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Overview

Package remote implements the device-side remote operations client: it advertises capability to the Online API, long-polls for queued operations, executes them locally, and reports results back, replaying any result the device couldn't report the first time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, deps *Deps, wg *sync.WaitGroup)

Start launches the remote operations polling loop in a background goroutine registered on wg. It returns immediately.

Types

type Deps

type Deps struct {
	Platform        platforms.Platform
	Config          *config.Instance
	State           *state.State
	DB              *database.Database
	Profiles        *profiles.Service
	PlaybackManager audio.PlaybackManager
	UI              *uievents.Service
	ConfirmQueue    chan chan error
	PlaylistQueue   chan *playlists.Playlist
	IndexPauser     *syncutil.Pauser
	ScrapePauser    *syncutil.Pauser
	BackupPauser    *syncutil.Pauser
	// Methods resolves API method handlers for allowlisted operations that
	// dispatch through the shared registry instead of bespoke adapters. See
	// allowlist.go.
	Methods      MethodResolver
	RunZapScript func(
		ctx context.Context, token tokens.Token, plsc playlists.PlaylistController,
		exprEnv *gozapscript.ArgExprEnv, inHookContext bool,
	) error
}

Deps are the dependencies Start needs from the running service. RunZapScript is a callback rather than a direct function reference because the actual ZapScript runner lives in the parent service package, which imports this package to call Start — calling back the other way would be a cycle.

type MethodResolver

type MethodResolver interface {
	GetMethod(name string) (func(requests.RequestEnv) (any, error), bool)
}

MethodResolver looks up a registered API method handler by name. Satisfied structurally by *api.MethodMap. Kept as a narrow interface, rather than importing pkg/api directly, so a test can inject a two-entry fake instead of standing up the whole registry, and so this package's dependency graph stays limited to pkg/api/models and pkg/api/permissions.

Jump to

Keyboard shortcuts

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