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 ¶
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
// 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 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. |