Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { LogPath string `yaml:"log-path" json:"log-path,omitempty"` Debug bool `yaml:"debug" json:"debug,omitempty"` Verbose bool `yaml:"verbose" json:"verbose,omitempty"` Listen string `yaml:"listen" json:"listen,omitempty"` Socks5 string `yaml:"socks5" json:"socks5,omitempty"` Keys []string `yaml:"keys" json:"-"` Policy string `yaml:"policy" json:"policy,omitempty"` Rules Rules `yaml:"rules" json:"rules,omitempty"` ExtraModels []string `yaml:"extra-models" json:"extra-models,omitempty"` EnablePrometheus bool `yaml:"enable-prometheus" json:"enable-prometheus,omitempty"` }
func LoadConfig ¶
type ModelRewrite ¶
type Rule ¶
type Rule struct { Name string `yaml:"name" json:"name,omitempty"` Servers []string `yaml:"servers" json:"servers"` Keys []string `yaml:"keys" json:"-"` Models []string `yaml:"models" json:"models"` ModelKeys []ModelKey `yaml:"model-keys" json:"model-keys"` Proxy bool `yaml:"proxy,omitempty" json:"proxy,omitempty"` Type base.ChannelType `yaml:"type,omitempty" json:"type,omitempty"` AzureAPIVersion string `yaml:"azure-api-version,omitempty" json:"azure-api-version,omitempty"` Rewrite []ModelRewrite `yaml:"rewrite,omitempty" json:"rewrite,omitempty"` // Default Default rule Default bool `yaml:"default,omitempty" json:"default,omitempty"` // Backup Alternate rule, which is not used by default and is used only when an error occurs Backup bool `yaml:"backup,omitempty" json:"backup,omitempty"` // Weight, used for the weight policy. The default value is 1. A negative value indicates that the rule is not used Weight int `yaml:"weight,omitempty" json:"weight,omitempty"` // Advanced configuration Expr *Expr `yaml:"expr,omitempty" json:"expr,omitempty"` }
func (Rule) ModelReplacer ¶
Click to show internal directories.
Click to hide internal directories.