api

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: GPL-3.0 Imports: 34 Imported by: 0

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,
)

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)

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