Documentation
¶
Overview ¶
Package management provides the management API handlers and middleware for configuring the server and managing auth files.
Index ¶
- func WriteConfig(path string, data []byte) error
- type Handler
- func (h *Handler) DeleteAPIKeys(c *gin.Context)
- func (h *Handler) DeleteAuthFile(c *gin.Context)
- func (h *Handler) DeleteClaudeKey(c *gin.Context)
- func (h *Handler) DeleteCodexKey(c *gin.Context)
- func (h *Handler) DeleteGlKeys(c *gin.Context)
- func (h *Handler) DeleteLogs(c *gin.Context)
- func (h *Handler) DeleteOpenAICompat(c *gin.Context)
- func (h *Handler) DeleteProxyURL(c *gin.Context)
- func (h *Handler) DownloadAuthFile(c *gin.Context)
- func (h *Handler) GetAPIKeys(c *gin.Context)
- func (h *Handler) GetAuthStatus(c *gin.Context)
- func (h *Handler) GetClaudeKeys(c *gin.Context)
- func (h *Handler) GetCodexKeys(c *gin.Context)
- func (h *Handler) GetConfig(c *gin.Context)
- func (h *Handler) GetConfigFile(c *gin.Context)
- func (h *Handler) GetConfigYAML(c *gin.Context)
- func (h *Handler) GetDebug(c *gin.Context)
- func (h *Handler) GetGlKeys(c *gin.Context)
- func (h *Handler) GetLoggingToFile(c *gin.Context)
- func (h *Handler) GetLogs(c *gin.Context)
- func (h *Handler) GetOpenAICompat(c *gin.Context)
- func (h *Handler) GetProxyURL(c *gin.Context)
- func (h *Handler) GetRequestLog(c *gin.Context)
- func (h *Handler) GetRequestRetry(c *gin.Context)
- func (h *Handler) GetSwitchPreviewModel(c *gin.Context)
- func (h *Handler) GetSwitchProject(c *gin.Context)
- func (h *Handler) GetUsageStatistics(c *gin.Context)
- func (h *Handler) GetUsageStatisticsEnabled(c *gin.Context)
- func (h *Handler) ListAuthFiles(c *gin.Context)
- func (h *Handler) Middleware() gin.HandlerFunc
- func (h *Handler) PatchAPIKeys(c *gin.Context)
- func (h *Handler) PatchClaudeKey(c *gin.Context)
- func (h *Handler) PatchCodexKey(c *gin.Context)
- func (h *Handler) PatchGlKeys(c *gin.Context)
- func (h *Handler) PatchOpenAICompat(c *gin.Context)
- func (h *Handler) PutAPIKeys(c *gin.Context)
- func (h *Handler) PutClaudeKeys(c *gin.Context)
- func (h *Handler) PutCodexKeys(c *gin.Context)
- func (h *Handler) PutConfigYAML(c *gin.Context)
- func (h *Handler) PutDebug(c *gin.Context)
- func (h *Handler) PutGlKeys(c *gin.Context)
- func (h *Handler) PutLoggingToFile(c *gin.Context)
- func (h *Handler) PutOpenAICompat(c *gin.Context)
- func (h *Handler) PutProxyURL(c *gin.Context)
- func (h *Handler) PutRequestLog(c *gin.Context)
- func (h *Handler) PutRequestRetry(c *gin.Context)
- func (h *Handler) PutSwitchPreviewModel(c *gin.Context)
- func (h *Handler) PutSwitchProject(c *gin.Context)
- func (h *Handler) PutUsageStatisticsEnabled(c *gin.Context)
- func (h *Handler) RequestAnthropicToken(c *gin.Context)
- func (h *Handler) RequestCodexToken(c *gin.Context)
- func (h *Handler) RequestGeminiCLIToken(c *gin.Context)
- func (h *Handler) RequestIFlowToken(c *gin.Context)
- func (h *Handler) RequestQwenToken(c *gin.Context)
- func (h *Handler) SetAuthManager(manager *coreauth.Manager)
- func (h *Handler) SetConfig(cfg *config.Config)
- func (h *Handler) SetLocalPassword(password string)
- func (h *Handler) SetLogDirectory(dir string)
- func (h *Handler) SetUsageStatistics(stats *usage.RequestStatistics)
- func (h *Handler) UploadAuthFile(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteConfig ¶ added in v6.2.25
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler aggregates config reference, persistence path and helpers.
func NewHandler ¶
NewHandler creates a new management handler instance.
func (*Handler) DeleteAPIKeys ¶
func (*Handler) DeleteAuthFile ¶
Delete auth files: single by name or all
func (*Handler) DeleteClaudeKey ¶
func (*Handler) DeleteCodexKey ¶
func (*Handler) DeleteGlKeys ¶
func (*Handler) DeleteLogs ¶ added in v6.2.14
DeleteLogs removes all rotated log files and truncates the active log.
func (*Handler) DeleteOpenAICompat ¶
func (*Handler) DeleteProxyURL ¶
func (*Handler) DownloadAuthFile ¶
Download single auth file by name
func (*Handler) GetAuthStatus ¶
func (*Handler) GetClaudeKeys ¶
claude-api-key: []ClaudeKey
func (*Handler) GetCodexKeys ¶
codex-api-key: []CodexKey
func (*Handler) GetConfigFile ¶ added in v6.2.25
GetConfigFile returns the raw config.yaml file bytes without re-encoding. It preserves comments and original formatting/styles.
func (*Handler) GetConfigYAML ¶ added in v6.2.25
func (*Handler) GetLoggingToFile ¶ added in v6.0.5
UsageStatisticsEnabled
func (*Handler) GetLogs ¶ added in v6.2.14
GetLogs returns log lines with optional incremental loading.
func (*Handler) GetOpenAICompat ¶
openai-compatibility: []OpenAICompatibility
func (*Handler) GetSwitchPreviewModel ¶
func (*Handler) GetSwitchProject ¶
Quota exceeded toggles
func (*Handler) GetUsageStatistics ¶
GetUsageStatistics returns the in-memory request statistics snapshot.
func (*Handler) GetUsageStatisticsEnabled ¶ added in v6.0.5
UsageStatisticsEnabled
func (*Handler) Middleware ¶
func (h *Handler) Middleware() gin.HandlerFunc
Middleware enforces access control for management endpoints. All requests (local and remote) require a valid management key. Additionally, remote access requires allow-remote-management=true.
func (*Handler) PatchAPIKeys ¶
func (*Handler) PatchClaudeKey ¶
func (*Handler) PatchCodexKey ¶
func (*Handler) PatchGlKeys ¶
func (*Handler) PatchOpenAICompat ¶
func (*Handler) PutAPIKeys ¶
func (*Handler) PutClaudeKeys ¶
func (*Handler) PutCodexKeys ¶
func (*Handler) PutConfigYAML ¶ added in v6.2.25
func (*Handler) PutLoggingToFile ¶ added in v6.0.5
func (*Handler) PutOpenAICompat ¶
func (*Handler) PutProxyURL ¶
func (*Handler) PutRequestLog ¶
func (*Handler) PutRequestRetry ¶
func (*Handler) PutSwitchPreviewModel ¶
func (*Handler) PutSwitchProject ¶
func (*Handler) PutUsageStatisticsEnabled ¶ added in v6.0.5
func (*Handler) RequestAnthropicToken ¶
func (*Handler) RequestCodexToken ¶
func (*Handler) RequestGeminiCLIToken ¶
func (*Handler) RequestIFlowToken ¶ added in v6.1.0
func (*Handler) RequestQwenToken ¶
func (*Handler) SetAuthManager ¶
SetAuthManager updates the auth manager reference used by management endpoints.
func (*Handler) SetConfig ¶
SetConfig updates the in-memory config reference when the server hot-reloads.
func (*Handler) SetLocalPassword ¶ added in v6.0.1
SetLocalPassword configures the runtime-local password accepted for localhost requests.
func (*Handler) SetLogDirectory ¶ added in v6.2.14
SetLogDirectory updates the directory where main.log should be looked up.
func (*Handler) SetUsageStatistics ¶
func (h *Handler) SetUsageStatistics(stats *usage.RequestStatistics)
SetUsageStatistics allows replacing the usage statistics reference.
func (*Handler) UploadAuthFile ¶
Upload auth file: multipart or raw JSON with ?name=