Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultMaxRetries = 3 DefaultMaxDiffLines = 10 DefaultCommitMsgTimeout = 30 * time.Second DefaultRequestTimeout = 30 * time.Second DefaultLogFilePerms = os.FileMode(0o666) DefaultLogDirPerms = os.FileMode(0o755) DefaultPermissionsMask = os.FileMode(0o777) DefaultLineLength = 72 // Common time formats TimeFormatRFC3339 = "2006-01-02T15:04:05Z07:00" TimeFormatUnix = "2006-01-02 15:04:05" TimeFormatSimple = "2006-01-02" )
Variables ¶
This section is empty.
Functions ¶
func ParseFlags ¶
func SetDefaults ¶
func SetDefaults()
Types ¶
type Config ¶
type Config struct { Logging LoggingConfig `mapstructure:"logging"` Git GitConfig `mapstructure:"git"` LLM LLMConfig `mapstructure:"llm"` Functions []LLMFunction `mapstructure:"functions"` Command string `mapstructure:"command"` Version VersionConfig `mapstructure:"version"` NoConfirm bool `mapstructure:"no_confirm"` }
type EnvironmentConfig ¶
type EnvironmentConfig struct { Name string `mapstructure:"name"` TimeFormat string `mapstructure:"timeformat"` Output string `mapstructure:"output"` Level string `mapstructure:"level"` Path string `mapstructure:"file_path,omitempty"` FilePerms os.FileMode `mapstructure:"file_perms,omitempty"` DirPerms os.FileMode `mapstructure:"dir_perms,omitempty"` }
func (*EnvironmentConfig) Validate ¶
func (c *EnvironmentConfig) Validate() error
type FunctionParameters ¶
type LLMConfig ¶
type LLMConfig struct { Provider string Model string BaseURL string `mapstructure:"base_url"` APIKey string `mapstructure:"api_key,omitempty"` // Make API key optional MaxRetries int `mapstructure:"max_retries"` CommitMsgTimeout time.Duration `mapstructure:"commit_msg_timeout"` RequestTimeout time.Duration `mapstructure:"request_timeout"` }
type LLMFunction ¶
type LLMFunction struct { Name string `mapstructure:"name" yaml:"name"` Description string `mapstructure:"description" yaml:"description"` Parameters FunctionParameters `mapstructure:"parameters" yaml:"parameters"` SystemPrompt string `mapstructure:"system_prompt" yaml:"system_prompt"` //nolint:tagliatelle // Following OpenAI API spec UserPrompt string `mapstructure:"user_prompt" yaml:"user_prompt"` //nolint:tagliatelle // Following OpenAI API spec }
func FindFunction ¶
func FindFunction(functions []LLMFunction, name string) *LLMFunction
type LoggingConfig ¶
type LoggingConfig struct { Environment string `mapstructure:"environment"` TimeFormat string `mapstructure:"timeformat"` Output string `mapstructure:"output"` Level string `mapstructure:"level"` Path string `mapstructure:"file_path"` FilePerms os.FileMode `mapstructure:"file_perms"` DirPerms os.FileMode `mapstructure:"dir_perms"` Environments []EnvironmentConfig `mapstructure:"environments"` }
func LoadInitialLogging ¶
func LoadInitialLogging() (*LoggingConfig, error)
func (*LoggingConfig) ActiveEnvironment ¶
func (c *LoggingConfig) ActiveEnvironment() *EnvironmentConfig
func (*LoggingConfig) ToLoggerConfig ¶
func (c *LoggingConfig) ToLoggerConfig() logger.Config
type VersionConfig ¶
type VersionConfig struct { Current string `mapstructure:"current"` Git VersionGit `mapstructure:"git"` Prerelease []string `mapstructure:"prerelease"` Files []VersionFile `mapstructure:"files"` Alpha bool `mapstructure:"alpha"` Beta bool `mapstructure:"beta"` RC bool `mapstructure:"rc"` }
func (*VersionConfig) Validate ¶
func (v *VersionConfig) Validate() error
type VersionFile ¶
type VersionGit ¶
Click to show internal directories.
Click to hide internal directories.