Documentation
¶
Overview ¶
Package config loads and validates runtime configuration.
Environment variables (GDOCS_*) are the source of truth because every MCP client (Claude Code, Claude Desktop, Cursor) passes only command, args and env to a stdio server. Each setting also has a flag bound to the same name; a flag given explicitly overrides the environment. Validation runs once at start so a misconfigured server fails before it announces itself.
Index ¶
Constants ¶
const EnvPrefix = "GDOCS_"
EnvPrefix is prepended to every environment variable name.
Variables ¶
var ErrInvalid = errors.New("config: invalid")
ErrInvalid wraps every validation failure.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Profile string
LogLevel LogLevel
LogFormat LogFormat
Preview bool
DefaultWriteMode WriteMode
ReadOnly bool
EnableDestructive bool
ExportDir string
HTTPTimeout time.Duration
ClientSecretPath string
}
Config is the validated runtime configuration.
func (Config) AvailableWriteModes ¶
AvailableWriteModes lists the modes this configuration can honour.
type LogLevel ¶
type LogLevel string
LogLevel is a typed enum constrained at load time.
type Settings ¶
type Settings struct {
Profile string
LogLevel string
LogFormat string
Preview string
DefaultWriteMode string
ReadOnly string
EnableDestructive string
ExportDir string
HTTPTimeout string
ClientSecretPath string
}
Settings holds the raw string values before validation. Flags and the environment both feed it; Build turns it into a Config.