api

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: GPL-3.0 Imports: 20 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGitHubFlow

func IsGitHubFlow(sourceType string) bool

IsGitHubFlow reports whether the given source type should use the GitHub device code flow (as opposed to the Microsoft flow).

func LogAPIKeyStatus added in v0.1.5

func LogAPIKeyStatus()

LogAPIKeyStatus logs whether API/MCP bearer-token auth is enabled. Call once from main after creating the server.

Types

type Server

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

Server is the REST API server for the Web UI.

func NewServer

func NewServer(store *db.Store, c *crawler.Crawler, mcpHandler http.Handler, key []byte) *Server

NewServer creates a new API server wired to the given store, crawler, and MCP handler. Pass nil for mcpHandler and/or crawler when not needed (e.g. in tests). key must be exactly 32 bytes and is used for AES-256-GCM token encryption.

func NewServerWithMCPHandlers added in v0.1.3

func NewServerWithMCPHandlers(store *db.Store, c *crawler.Crawler, mcpHandler, mcpStreamableHandler http.Handler, key []byte) *Server

NewServerWithMCPHandlers creates a new API server with separate MCP handlers for SSE (/mcp/sse) and streamable HTTP (/mcp/http) clients.

func (*Server) ServeHTTP

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

ServeHTTP implements http.Handler.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown cancels background operations (e.g. in-progress crawls) started by this server. It should be called during process shutdown after the HTTP server has stopped accepting new requests.

Jump to

Keyboard shortcuts

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