config

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Port is the network port on which the API server will listen.
	Port int `yaml:"port"`
	// AuthDir is the directory where authentication token files are stored.
	AuthDir string `yaml:"auth-dir"`
	// Debug enables or disables debug-level logging and other debug features.
	Debug bool `yaml:"debug"`
	// ProxyUrl is the URL of an optional proxy server to use for outbound requests.
	ProxyUrl string `yaml:"proxy-url"`
	// ApiKeys is a list of keys for authenticating clients to this proxy server.
	ApiKeys []string `yaml:"api-keys"`
	// QuotaExceeded defines the behavior when a quota is exceeded.
	QuotaExceeded ConfigQuotaExceeded `yaml:"quota-exceeded"`
	// GlAPIKey is the API key for the generative language API.
	GlAPIKey []string `yaml:"generative-language-api-key"`
}

Config represents the application's configuration, loaded from a YAML file.

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

LoadConfig reads a YAML configuration file from the given path, unmarshals it into a Config struct, and returns it.

type ConfigQuotaExceeded added in v1.6.0

type ConfigQuotaExceeded struct {
	// SwitchProject indicates whether to automatically switch to another project when a quota is exceeded.
	SwitchProject bool `yaml:"switch-project"`
	// SwitchPreviewModel indicates whether to automatically switch to a preview model when a quota is exceeded.
	SwitchPreviewModel bool `yaml:"switch-preview-model"`
}

Jump to

Keyboard shortcuts

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