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 ¶
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.