config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load added in v1.0.0

func Load(filename string, cfg *Config) error

Types

type Config

type Config struct {
	modules.BaseConfig
	Log              modules.LogConfig       `yaml:"log" json:"log" envconfig:"LOG"`
	AccessLog        modules.AccessLogConfig `yaml:"access_log" json:"access_log" envconfig:"ACCESS_LOG"`
	Database         modules.DatabaseConfig  `yaml:"database" json:"database" envconfig:"DATABASE"`
	Redis            modules.RedisConfig     `yaml:"redis" json:"redis" envconfig:"REDIS"`
	Admin            modules.AdminConfig     `yaml:"admin" json:"admin" envconfig:"ADMIN"`
	Status           modules.StatusConfig    `yaml:"status" json:"status" envconfig:"STATUS"`
	Proxy            modules.ProxyConfig     `yaml:"proxy" json:"proxy" envconfig:"PROXY"`
	Worker           modules.WorkerConfig    `yaml:"worker" json:"worker" envconfig:"WORKER"`
	Metrics          modules.MetricsConfig   `yaml:"metrics" json:"metrics" envconfig:"METRICS"`
	Tracing          modules.TracingConfig   `yaml:"tracing" json:"tracing" envconfig:"TRACING"`
	Role             Role                    `yaml:"role" json:"role" envconfig:"ROLE" default:"standalone"`
	AnonymousReports bool                    `yaml:"anonymous_reports" json:"anonymous_reports" envconfig:"ANONYMOUS_REPORTS" default:"true"`
	Secret           modules.SecretConfig    `yaml:"secret" json:"secret" envconfig:"SECRET"`
}

Config Configuration

func New added in v1.0.0

func New() *Config

func (*Config) PostProcess added in v1.0.0

func (cfg *Config) PostProcess() error

func (Config) String

func (cfg Config) String() string

func (Config) Validate

func (cfg Config) Validate() error

type Loader added in v1.0.0

type Loader struct {
	// contains filtered or unexported fields
}

Loader is configuration loader

func NewLoader added in v1.0.0

func NewLoader(cfg *Config) *Loader

func (*Loader) Load added in v1.0.0

func (l *Loader) Load() error

func (*Loader) WithEnv added in v1.0.1

func (l *Loader) WithEnv(env map[string]string) *Loader

func (*Loader) WithEnvPrefix added in v1.0.0

func (l *Loader) WithEnvPrefix(prefix string) *Loader

func (*Loader) WithFileContent added in v1.0.0

func (l *Loader) WithFileContent(content []byte) *Loader

func (*Loader) WithFilename added in v1.0.0

func (l *Loader) WithFilename(filename string) *Loader

type Role added in v0.8.0

type Role string
const (
	RoleStandalone Role = "standalone"
	RoleCP         Role = "cp"
	RoleDPWorker   Role = "dp_worker"
	RoleDPProxy    Role = "dp_proxy"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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