api

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package api contains the REST API for ToolHive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DocsRouter added in v0.0.35

func DocsRouter() http.Handler

DocsRouter creates a new router for documentation endpoints.

func Serve

func Serve(
	ctx context.Context,
	address string,
	isUnixSocket bool,
	debugMode bool,
	enableDocs bool,
	oidcConfig *auth.TokenValidatorConfig,
) error

Serve starts the server on the given address and serves the API. It is assumed that the caller sets up appropriate signal handling. If isUnixSocket is true, address is treated as a UNIX socket path. If oidcConfig is provided, OIDC authentication will be enabled for all API endpoints.

func ServeOpenAPI added in v0.0.35

func ServeOpenAPI(w http.ResponseWriter, _ *http.Request)

ServeOpenAPI writes the OpenAPI specification as JSON to the response. @Summary Get OpenAPI specification @Description Returns the OpenAPI specification for the API @Tags system @Produce json @Success 200 {object} object "OpenAPI specification" @Router /api/openapi.json [get]

func ServeScalar added in v0.0.35

func ServeScalar(w http.ResponseWriter, _ *http.Request)

ServeScalar serves the Scalar API reference page

Types

This section is empty.

Directories

Path Synopsis
Package v1 contains the V1 API for ToolHive.
Package v1 contains the V1 API for ToolHive.

Jump to

Keyboard shortcuts

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