Documentation
¶
Overview ¶
Package modules provides a pluggable routing module system for extending the API server with optional features without modifying core routing logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterModule ¶
RegisterModule registers a module using the RouteModuleV2 interface.
Example usage:
ctx := modules.Context{
Engine: engine,
BaseHandler: baseHandler,
Config: cfg,
AuthMiddleware: authMiddleware,
}
if err := modules.RegisterModule(ctx, ampModule); err != nil {
log.Errorf("Failed to register module: %v", err)
}
Types ¶
type Context ¶
type Context struct {
Engine *gin.Engine
BaseHandler *handlers.BaseAPIHandler
Config *config.Config
AuthMiddleware gin.HandlerFunc
}
Context encapsulates the dependencies exposed to routing modules during registration. Modules can use the Gin engine to attach routes, the shared BaseAPIHandler for constructing SDK-specific handlers, and the resolved authentication middleware for protecting routes that require API keys.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package amp implements the Amp CLI routing module, providing OAuth-based integration with Amp CLI for ChatGPT and Anthropic subscriptions.
|
Package amp implements the Amp CLI routing module, providing OAuth-based integration with Amp CLI for ChatGPT and Anthropic subscriptions. |
Click to show internal directories.
Click to hide internal directories.