api

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 9 Imported by: ? modules, 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

Overview

Package api provides the extensible HTTP Admin API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

Dependencies configures system repositories, observability and authentication.

type ProtectedHandlerFunc added in v1.0.2

type ProtectedHandlerFunc func(http.ResponseWriter, *http.Request, *auth.Claims)

ProtectedHandlerFunc handles an authorized request with verified claims.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves built-in system endpoints and application-defined routes.

func New

func New() *Server

New creates a server with system routes and no external dependencies.

func NewWithDependencies

func NewWithDependencies(deps Dependencies) *Server

NewWithDependencies creates a server and derives repositories from Store when set.

func NewWithPlugins

func NewWithPlugins(plugins *plugin.Registry) *Server

NewWithPlugins creates a server backed by a plugin registry.

func (*Server) Handle added in v1.0.2

func (s *Server) Handle(pattern string, handler http.Handler)

Handle registers an application route using net/http ServeMux patterns.

func (*Server) HandleFunc added in v1.0.2

func (s *Server) HandleFunc(pattern string, handler http.HandlerFunc)

HandleFunc registers an application handler using net/http ServeMux patterns.

func (*Server) HandleProtected added in v1.0.2

func (s *Server) HandleProtected(pattern, permission string, handler ProtectedHandlerFunc)

HandleProtected registers a route guarded by the configured verifier and permission.

func (*Server) Listen

func (s *Server) Listen(addr string) error

Listen serves HTTP requests on addr and blocks until the server stops.

func (*Server) ServeHTTP added in v1.0.2

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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