config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentVersion = "2"

Variables

This section is empty.

Functions

func SaveConfig

func SaveConfig(cfg *Config, path string) error

Types

type Account

type Account struct {
	Name         string    `yaml:"name"`
	KeyID        string    `yaml:"key_id"`
	CreatedAt    time.Time `yaml:"created_at"`
	LastVerified time.Time `yaml:"last_verified"`
}

type Config

type Config struct {
	Version         string                    `yaml:"version"`
	Accounts        map[string]Account        `yaml:"accounts"`
	Providers       map[string]ProviderConfig `yaml:"providers"`
	ColorThresholds struct {
		Warning int `yaml:"warning"`
		Danger  int `yaml:"danger"`
	} `yaml:"color_thresholds"`
	MaxConcurrentRequests int   `yaml:"max_concurrent_requests"`
	UseMasterPassword     *bool `yaml:"use_master_password,omitempty"`
}

func LoadOrCreateConfig

func LoadOrCreateConfig(path string) (*Config, error)

type ProviderConfig added in v0.3.0

type ProviderConfig struct {
	Enabled   bool   `yaml:"enabled"`
	APIKey    string `yaml:"api_key,omitempty"`    // OpenCode, Volcengine
	CredsPath string `yaml:"creds_path,omitempty"` // Claude
	AuthPath  string `yaml:"auth_path,omitempty"`  // Codex
	Endpoint  string `yaml:"endpoint,omitempty"`   // 自定义端点
}

ProviderConfig 配置各个 provider

Jump to

Keyboard shortcuts

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