httpapi

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package httpapi serves the REST endpoints and mounts the MCP handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(deps Deps) http.Handler

Handler builds the full HTTP surface.

func Server

func Server(addr string, h http.Handler) *http.Server

Server wraps the handler with timeouts.

WriteTimeout is generous because a cold browser start routinely takes tens of seconds, but every timeout is set: leaving them unset lets slow clients accumulate connections indefinitely.

Types

type Deps

type Deps struct {
	Auth   *auth.Manager
	Reader *read.Reader
	Writer write.Actions
	MCP    *mcp.Server
	Log    *slog.Logger

	// ListenAddr is the address the server was told to bind, and AllowedHosts
	// any further names it answers to. The handler needs them to know which Host
	// names itself; see guard.
	ListenAddr   string
	AllowedHosts []string
}

Deps are what the handlers operate on.

Jump to

Keyboard shortcuts

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