Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config struct {
	Dir           string `validate:"required"`
	Debug         bool
	Profiles      []*Profile `validate:"dive"`
	ChatProfiles  []string
	OutputBufSize int
}

Functions

func Init

func Init() error

Init reads configuration from flags, environment variables, and config files.

func LoadConfigFile

func LoadConfigFile(path string, config *ConfigFile) error

LoadConfigFile reads a YAML configuration file and updates combined config.

Types

type ConfigFile

type ConfigFile struct {
	Default *string `yaml:"default" validate:"omitempty,min=1"`

	Profiles map[string]*ConfigFileProfile `yaml:"profiles"`
}

type ConfigFileProfile

type ConfigFileProfile struct {
	Preset *string `yaml:"preset" validate:"omitempty,min=1"`

	BaseURL string `yaml:"baseurl" validate:"omitempty,url"`
	Key     string `yaml:"key" validate:"omitempty"`
	Model   string `yaml:"model" validate:"omitempty"`

	Prompt string `yaml:"prompt" validate:"omitempty"`

	Concurrency int `yaml:"concurrency" validate:"omitempty,min=1"`
	ContextSize int `yaml:"context" validate:"omitempty,min=2000"`
}

type Profile

type Profile struct {
	Profile string

	BaseURL string `validate:"required,url"`
	Key     string `validate:"required"`
	Model   string `validate:"required"`

	Prompt string

	Concurrency int `validate:"required,min=1"`
	ContextSize int `validate:"required,min=2000"`
}

Jump to

Keyboard shortcuts

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