Documentation
¶
Overview ¶
Package api exposes helpers for embedding CLIProxyAPI.
It wraps internal management handler types so external projects can integrate management endpoints without importing internal packages.
Package api exposes server option helpers for embedding CLIProxyAPI.
It wraps internal server option types so external projects can configure the embedded HTTP server without importing internal packages.
Index ¶
- type ManagementTokenRequester
- type ServerOption
- func WithEngineConfigurator(fn func(*gin.Engine)) ServerOption
- func WithKeepAliveEndpoint(timeout time.Duration, onTimeout func()) ServerOption
- func WithLocalManagementPassword(password string) ServerOption
- func WithMiddleware(mw ...gin.HandlerFunc) ServerOption
- func WithRequestLoggerFactory(factory func(*config.Config, string) logging.RequestLogger) ServerOption
- func WithRouterConfigurator(fn func(*gin.Engine, *handlers.BaseAPIHandler, *config.Config)) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManagementTokenRequester ¶ added in v6.6.64
type ManagementTokenRequester interface {
RequestAnthropicToken(*gin.Context)
RequestGeminiCLIToken(*gin.Context)
RequestCodexToken(*gin.Context)
RequestAntigravityToken(*gin.Context)
RequestQwenToken(*gin.Context)
RequestIFlowToken(*gin.Context)
RequestIFlowCookieToken(*gin.Context)
GetAuthStatus(c *gin.Context)
}
ManagementTokenRequester exposes a limited subset of management endpoints for requesting tokens.
func NewManagementTokenRequester ¶ added in v6.6.64
func NewManagementTokenRequester(cfg *config.Config, manager *coreauth.Manager) ManagementTokenRequester
NewManagementTokenRequester creates a limited management handler exposing only token request endpoints.
type ServerOption ¶
type ServerOption = internalapi.ServerOption
ServerOption customises HTTP server construction.
func WithEngineConfigurator ¶
func WithEngineConfigurator(fn func(*gin.Engine)) ServerOption
WithEngineConfigurator allows callers to mutate the Gin engine prior to middleware setup.
func WithKeepAliveEndpoint ¶
func WithKeepAliveEndpoint(timeout time.Duration, onTimeout func()) ServerOption
WithKeepAliveEndpoint enables a keep-alive endpoint with the provided timeout and callback.
func WithLocalManagementPassword ¶
func WithLocalManagementPassword(password string) ServerOption
WithLocalManagementPassword stores a runtime-only management password accepted for localhost requests.
func WithMiddleware ¶
func WithMiddleware(mw ...gin.HandlerFunc) ServerOption
WithMiddleware appends additional Gin middleware during server construction.
func WithRequestLoggerFactory ¶
func WithRequestLoggerFactory(factory func(*config.Config, string) logging.RequestLogger) ServerOption
WithRequestLoggerFactory customises request logger creation.
func WithRouterConfigurator ¶
func WithRouterConfigurator(fn func(*gin.Engine, *handlers.BaseAPIHandler, *config.Config)) ServerOption
WithRouterConfigurator appends a callback after default routes are registered.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package handlers provides core API handler functionality for the CLI Proxy API server.
|
Package handlers provides core API handler functionality for the CLI Proxy API server. |
|
claude
Package claude provides HTTP handlers for Claude API code-related functionality.
|
Package claude provides HTTP handlers for Claude API code-related functionality. |
|
gemini
Package gemini provides HTTP handlers for Gemini CLI API functionality.
|
Package gemini provides HTTP handlers for Gemini CLI API functionality. |
|
openai
Package openai provides HTTP handlers for OpenAI API endpoints.
|
Package openai provides HTTP handlers for OpenAI API endpoints. |