api

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package api mounts the REST surface. It owns route registration and the middleware chain (JSON errors, then x-api-key auth); the operations themselves live in api/v1, which declares each route and its OpenAPI entry from the same call so the published spec cannot drift from what is enforced.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(srv *server.Server, deps *Deps)

RegisterRoutes registers all API route handlers on the server.

Types

type Deps

type Deps struct {
	Store    repo.Store
	Engine   *deploy.Engine
	Runtime  *runtime.Runtime
	Cluster  *cluster.Cluster // one door for every docker call (docs/plans/35-cluster.md)
	Proxy    *proxy.Proxy
	Jobs     *jobs.Service
	Backups  *backup.Service
	Forwards *forward.Registry
	Notifier *notify.Notifier
	// Applier drives config-as-code. Shared with the web router so the plan
	// the canvas shows and the plan the API approves are the same object.
	Applier stackconf.Applier
	// Work is the durable job runner; applies are enqueued, not run inline.
	Work *workqueue.Queue
	// RegistrySigner mints managed-registry tokens; nil when it would not load.
	RegistrySigner *registry.Signer
	// Nodes takes the host metrics samples the node agents push.
	Nodes *nodes.Service
	// DataDir is where the panel keeps its copy of the agent runtime key,
	// which is what the sample push is authenticated against.
	DataDir string
	// Version is the panel's build, reported by /api/health.
	Version string
}

Deps holds the dependencies for API route registration.

Directories

Path Synopsis
handler
Package v1 is the REST API.
Package v1 is the REST API.

Jump to

Keyboard shortcuts

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