api

package
v2.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 35 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONRPCErrorInternalError = models.ErrorObject{
	Code:    -32603,
	Message: "Internal error",
}
View Source
var JSONRPCErrorInvalidParams = models.ErrorObject{
	Code:    -32602,
	Message: "Invalid params",
}
View Source
var JSONRPCErrorInvalidRequest = models.ErrorObject{
	Code:    -32600,
	Message: "Invalid Request",
}
View Source
var JSONRPCErrorMethodNotFound = models.ErrorObject{
	Code:    -32601,
	Message: "Method not found",
}
View Source
var JSONRPCErrorParseError = models.ErrorObject{
	Code:    -32700,
	Message: "Parse error",
}

Functions

func Start

func Start(
	platform platforms.Platform,
	cfg *config.Instance,
	st *state.State,
	inTokenQueue chan<- tokens.Token,
	db *database.Database,
	limitsManager *playtime.LimitsManager,
	notifications <-chan models.Notification,
	mdnsHostname string,
	player audio.Player,
)

Start starts the API web server and blocks until it shuts down.

Types

type MethodMap

type MethodMap struct {
	sync.Map
}

func NewMethodMap

func NewMethodMap() *MethodMap

func (*MethodMap) AddMethod

func (m *MethodMap) AddMethod(
	name string,
	handler func(requests.RequestEnv) (any, error),
) error

func (*MethodMap) GetMethod

func (m *MethodMap) GetMethod(name string) (func(requests.RequestEnv) (any, error), bool)

func (*MethodMap) ListMethods

func (m *MethodMap) ListMethods() []string

func (*MethodMap) Load

func (m *MethodMap) Load(key any) (any, bool)

func (*MethodMap) Range

func (m *MethodMap) Range(f func(key, value any) bool)

func (*MethodMap) Store

func (m *MethodMap) Store(key, value any)

type OriginsProvider added in v2.9.0

type OriginsProvider func() []string

OriginsProvider is a function that returns custom origins from config.

Directories

Path Synopsis
Package validation provides validation for API request parameters using go-playground/validator with custom validators for Zaparoo-specific types.
Package validation provides validation for API request parameters using go-playground/validator with custom validators for Zaparoo-specific types.

Jump to

Keyboard shortcuts

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