config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountConfig

type AccountConfig struct {
	ID           string    `yaml:"id" json:"id"`
	Pool         string    `yaml:"pool,omitempty" json:"pool,omitempty"`
	Email        string    `yaml:"email,omitempty" json:"email,omitempty"`
	RefreshToken string    `yaml:"refresh_token,omitempty" json:"refresh_token,omitempty"`
	AccessToken  string    `yaml:"access_token,omitempty" json:"access_token,omitempty"`
	ExpiresAt    time.Time `yaml:"expires_at,omitempty" json:"expires_at,omitempty"`
	ProjectID    string    `yaml:"project_id,omitempty" json:"project_id,omitempty"`
	ProfileARN   string    `yaml:"profile_arn,omitempty" json:"profile_arn,omitempty"`
	APIKey       string    `yaml:"api_key,omitempty" json:"api_key,omitempty"`
	AccountID    string    `yaml:"account_id,omitempty" json:"account_id,omitempty"`
	Status       string    `yaml:"status,omitempty" json:"status,omitempty"`
	Disabled     bool      `yaml:"disabled,omitempty" json:"disabled,omitempty"`
	Weight       float64   `yaml:"weight,omitempty" json:"weight,omitempty"`
}

type ComboConfig

type ComboConfig struct {
	Name     string        `yaml:"name" json:"name"`
	Strategy string        `yaml:"strategy" json:"strategy"` // "failover", "round_robin"
	Targets  []ComboTarget `yaml:"targets" json:"targets"`
}

type ComboTarget

type ComboTarget struct {
	ProviderID   string  `yaml:"provider_id" json:"provider_id"`
	Model        string  `yaml:"model" json:"model"`
	QuotaPercent float64 `yaml:"quota_percent,omitempty" json:"quota_percent,omitempty"`
}

type Config

type Config struct {
	Server    ServerConfig     `yaml:"server"`
	Providers []ProviderConfig `yaml:"providers"`
	Combos    []ComboConfig    `yaml:"combos"`
	Keys      []VirtualKey     `yaml:"keys,omitempty" json:"keys,omitempty"`
}

func DefaultConfig

func DefaultConfig() *Config

func Load

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

func (*Config) Save

func (c *Config) Save(path string) error

type ProviderConfig

type ProviderConfig struct {
	ID           string            `yaml:"id"`
	Type         string            `yaml:"type"` // "openai", "antigravity", "kiro"
	BaseURL      string            `yaml:"base_url,omitempty"`
	APIKey       string            `yaml:"api_key,omitempty"`
	RefreshToken string            `yaml:"refresh_token,omitempty"`
	ProfileARN   string            `yaml:"profile_arn,omitempty"`
	Strategy     string            `yaml:"strategy,omitempty"` // "priority", "round_robin", "balanced"
	Headers      map[string]string `yaml:"headers,omitempty"`
	Accounts     []AccountConfig   `yaml:"accounts,omitempty"`
}

type ServerConfig

type ServerConfig struct {
	Port             int    `yaml:"port" json:"port"`
	Host             string `yaml:"host" json:"host"`
	StorageDir       string `yaml:"storage_dir" json:"storage_dir"`
	DisableDashboard bool   `yaml:"disable_dashboard,omitempty" json:"disable_dashboard,omitempty"`
	EnableDashboard  bool   `yaml:"enable_dashboard,omitempty" json:"enable_dashboard,omitempty"`
}

type VirtualKey added in v0.3.0

type VirtualKey struct {
	ID              string    `yaml:"id" json:"id"`
	Name            string    `yaml:"name" json:"name"`
	Key             string    `yaml:"key" json:"key"` // e.g. "sk-goroute-..."
	IsActive        bool      `yaml:"is_active" json:"is_active"`
	AllowedModels   []string  `yaml:"allowed_models,omitempty" json:"allowed_models,omitempty"`
	MaxRPM          int       `yaml:"max_rpm,omitempty" json:"max_rpm,omitempty"`
	TotalTokensUsed int       `yaml:"total_tokens_used,omitempty" json:"total_tokens_used,omitempty"`
	CreatedAt       time.Time `yaml:"created_at" json:"created_at"`
}

Jump to

Keyboard shortcuts

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