module

package
v1.261203.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MPL-2.0 Imports: 2 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

Overview

Package module defines the contract every HTTP module under internal/server/module implements, so the host server mounts all of them the same way instead of through per-module RegisterRoutes signatures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(rt *Routes, mods ...Module)

Mount registers each module in order. Nil modules are skipped so callers can pass optional modules (built only when their dependencies exist) directly.

Types

type Module

type Module interface {
	RegisterRoutes(rt *Routes)
}

Module is an HTTP feature that can register its routes.

type Routes

type Routes struct {
	// Public is /api/v1 without authentication (health, auth validation).
	Public *swagger.RouteGroup
	// V1 is /api/v1 behind user authentication.
	V1 *swagger.RouteGroup
	// V2 is /api/v2 behind user authentication.
	V2 *swagger.RouteGroup
	// UserAuth is the user-authentication middleware already applied to V1
	// and V2, for the few routes that also attach it per-route
	// (swagger.WithMiddleware) so the generated spec records it.
	UserAuth gin.HandlerFunc
	// MCPAuth authenticates the MCP profile endpoints (MCP token or user
	// token); they are mounted on Public with it.
	MCPAuth gin.HandlerFunc
	// Engine is for routes that live outside the swagger-managed /api groups
	// (status line, notify hooks) and for callback routes that need their own
	// path layout.
	Engine *gin.Engine
	// Manager creates additional swagger-tracked groups (e.g. unauthenticated
	// OAuth callbacks).
	Manager *swagger.RouteManager
}

Routes is everything a module may register routes on. The host builds it once and hands the same value to every module, so a module picks the group that matches the auth and API version it needs rather than receiving auth middleware as a parameter.

Directories

Path Synopsis
Package apierr provides the shared JSON error-response writers for module HTTP handlers, so packages that must avoid importing internal/server can depend on error-response formatting without reintroducing that cycle.
Package apierr provides the shared JSON error-response writers for module HTTP handlers, so packages that must avoid importing internal/server can depend on error-response formatting without reintroducing that cycle.
Package bind holds the request-binding helper shared by module handlers.
Package bind holds the request-binding helper shared by module handlers.
Package debug exposes runtime memory diagnostics for a running instance: a memstats snapshot and a pprof heap profile.
Package debug exposes runtime memory diagnostics for a running instance: a memstats snapshot and a pprof heap profile.
Package imagegen exposes control-plane HTTP endpoints for the image generation scenario — separate from the OpenAI-compatible gateway routes under /tingly/imagegen, which only ever see requests/responses, never the local filesystem.
Package imagegen exposes control-plane HTTP endpoints for the image generation scenario — separate from the OpenAI-compatible gateway routes under /tingly/imagegen, which only ever see requests/responses, never the local filesystem.
wechat_qr.go implements the Weixin QR-login HTTP session flow.
wechat_qr.go implements the Weixin QR-login HTTP session flow.
Package versioncheck provides version lookup against the npm registry (with npmmirror as a China-mirror fallback) and semver-style comparison.
Package versioncheck provides version lookup against the npm registry (with npmmirror as a China-mirror fallback) and semver-style comparison.
Package limits exposes the live state of account concurrency / usage limits (see .design/routing-limits.md) so the UI can show who is busy right now.
Package limits exposes the live state of account concurrency / usage limits (see .design/routing-limits.md) so the UI can show who is busy right now.
Package notify — bot interaction API.
Package notify — bot interaction API.
Package paginate parses the limit/offset query parameters shared by list endpoints.
Package paginate parses the limit/offset query parameters shared by list endpoints.
Package projects mounts Projects (the projects/ module, see .design/projects.md) in Tingly Box: a Host that points its Claude Code sessions at the gateway, and the routes behind the "projects" feature flag.
Package projects mounts Projects (the projects/ module, see .design/projects.md) in Tingly Box: a Host that points its Claude Code sessions at the gateway, and the routes behind the "projects" feature flag.
Package provider handles CRUD and model-management HTTP endpoints for AI provider configurations.
Package provider handles CRUD and model-management HTTP endpoints for AI provider configurations.
Package apitoken implements CRUD HTTP endpoints for shared API tokens.
Package apitoken implements CRUD HTTP endpoints for shared API tokens.
Package shortcut exposes the /api/v1/shortcut HTTP endpoints that let the frontend create (or check for) the desktop / start-menu shortcut the CLI's `tingly-box shortcut` command already writes.
Package shortcut exposes the /api/v1/shortcut HTTP endpoints that let the frontend create (or check for) the desktop / start-menu shortcut the CLI's `tingly-box shortcut` command already writes.
Package uiprefs serves the UI-only preference store (config.UIPrefs): small per-instance settings the frontend keeps server-side so a browser tab and the desktop window see the same state.
Package uiprefs serves the UI-only preference store (config.UIPrefs): small per-instance settings the frontend keeps server-side so a browser tab and the desktop window see the same state.
Package virtualmodel exposes management endpoints for the in-process virtual-model providers.
Package virtualmodel exposes management endpoints for the in-process virtual-model providers.

Jump to

Keyboard shortcuts

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