config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config     *models.ServerConfig
	ConfigPath = "config.json"
)
View Source
var ClaudeManager *claudeauth.Manager

ClaudeManager is the singleton credential pool manager for claude-code providers. Set once at server startup by main.go before any requests are served.

View Source
var CodexManager *codexauth.Manager

CodexManager is the singleton credential pool manager for openai-codex providers. Set once at server startup by main.go before any requests are served.

Mu protects Config and config.json from concurrent reads/writes. Readers take RLock; the save path takes Lock.

Functions

func Init

func Init() error

func LoadConfigFromFile

func LoadConfigFromFile(path string) (*models.ServerConfig, error)

LoadConfigFromFile loads configuration from a JSON file.

func ReloadConfig

func ReloadConfig() error

ReloadConfig reloads the configuration from file. On failure the existing Config is preserved so callers always have a valid pointer.

func SaveConfig

func SaveConfig(cfg *models.ServerConfig) error

SaveConfig serialises the provider/analysis/notifications fields of cfg to ConfigPath atomically (write to tmp, then rename) and replaces the in-memory Config pointer. Feeds are excluded (they live in feeds.yml). The file is written with mode 0600 because it may contain OAuth tokens.

Types

This section is empty.

Jump to

Keyboard shortcuts

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