Documentation
¶
Overview ¶
Package config provides YAML configuration management with live reload support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConfigFile ¶
FindConfigFile searches for config in standard locations
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config provides thread-safe access to configuration with live reload
func (*Config) Get ¶
func (c *Config) Get() *ConfigData
Get returns current config snapshot (thread-safe read)
type ConfigData ¶
type ConfigData struct {
Server struct {
Port string `yaml:"port"`
ReadTimeout time.Duration `yaml:"read_timeout"`
WriteTimeout time.Duration `yaml:"write_timeout"`
IdleTimeout time.Duration `yaml:"idle_timeout"`
ShutdownTimeout time.Duration `yaml:"shutdown_timeout"`
} `yaml:"server"`
Claude struct {
Path string `yaml:"path"`
WorkingDir string `yaml:"working_dir"`
ExecutionTimeout time.Duration `yaml:"execution_timeout"`
MaxPromptLength int `yaml:"max_prompt_length"`
} `yaml:"claude"`
Session struct {
Timeout time.Duration `yaml:"timeout"`
CleanupInterval time.Duration `yaml:"cleanup_interval"`
} `yaml:"session"`
Telegram struct {
Enabled bool `yaml:"enabled"`
BotToken string `yaml:"bot_token"`
GroupSessionMode string `yaml:"group_session_mode"`
Voice struct {
Enabled bool `yaml:"enabled"`
MaxFileSize int64 `yaml:"max_file_size"`
DownloadTimeout time.Duration `yaml:"download_timeout"`
} `yaml:"voice"`
Photo struct {
Enabled bool `yaml:"enabled"`
MaxFileSize int64 `yaml:"max_file_size"`
DownloadTimeout time.Duration `yaml:"download_timeout"`
} `yaml:"photo"`
} `yaml:"telegram"`
Deepgram struct {
APIKey string `yaml:"api_key"`
Language string `yaml:"language"`
Model string `yaml:"model"`
} `yaml:"deepgram"`
Memory struct {
Enabled bool `yaml:"enabled"`
DBPath string `yaml:"db_path"`
Extraction struct {
Interval time.Duration `yaml:"interval"`
Timeout time.Duration `yaml:"timeout"`
MaxConversations int `yaml:"max_conversations"`
FactLimit int `yaml:"fact_limit"`
AdminTimeout time.Duration `yaml:"admin_timeout"`
} `yaml:"extraction"`
} `yaml:"memory"`
Scheduler struct {
Enabled bool `yaml:"enabled"`
Tasks []ScheduledTask `yaml:"tasks"`
} `yaml:"scheduler"`
}
ConfigData holds all configuration values
func DefaultConfig ¶
func DefaultConfig() *ConfigData
DefaultConfig returns config with sensible defaults
func LoadFromFile ¶
func LoadFromFile(path string) (*ConfigData, error)
LoadFromFile reads and parses YAML config file
func (*ConfigData) Validate ¶
func (c *ConfigData) Validate() error
Validate checks config values are valid
type ScheduledTask ¶
type ScheduledTask struct {
Name string `yaml:"name"`
Interval time.Duration `yaml:"interval"`
Type string `yaml:"type"`
Command string `yaml:"command"`
Args string `yaml:"args"`
WorkingDir string `yaml:"working_dir"`
Timeout time.Duration `yaml:"timeout"`
SkipPermissions bool `yaml:"skip_permissions"`
Enabled bool `yaml:"enabled"`
}
ScheduledTask represents a task to be executed on a schedule
Click to show internal directories.
Click to hide internal directories.