config

package
v0.2.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config configModel

Functions

func EnsureConfig added in v0.2.1

func EnsureConfig() (bool, error)

func EnsureRuntimePaths added in v0.2.1

func EnsureRuntimePaths() error

func GetLocalIP

func GetLocalIP() string

GetLocalIP 获取本地IP地址

func LoadConfig added in v0.2.0

func LoadConfig() error

LoadConfig reads config.yaml and populates the global Config. Environment variables ETL_USERNAME, ETL_PASSWORD, ETL_JWT_SECRET, ETL_API_SECRET, ETL_AES_KEY take precedence over values in the config file.

func SaveConfig

func SaveConfig() error

Types

type DatabaseConfig added in v0.2.0

type DatabaseConfig struct {
	Driver          string `yaml:"driver"`          // sqlite (default) | mysql | postgres
	Path            string `yaml:"path"`            // SQLite file path, default: ./data.db (only used when driver=sqlite)
	DSN             string `yaml:"dsn"`             // MySQL/PostgreSQL DSN, e.g. "user:pass@tcp(host:3306)/db?parseTime=True"
	MaxOpenConns    int    `yaml:"maxOpenConns"`    // default: 10
	MaxIdleConns    int    `yaml:"maxIdleConns"`    // default: 5
	ConnMaxLifetime int    `yaml:"connMaxLifetime"` // seconds, default: 300
}

type LogConfig added in v0.2.0

type LogConfig struct {
	Filename   string `yaml:"filename"`   // log file path, default: ./log/app.log
	MaxSize    int    `yaml:"maxSize"`    // MB per file, default: 20
	MaxBackups int    `yaml:"maxBackups"` // number of backups, default: 3
	MaxAge     int    `yaml:"maxAge"`     // days to retain, default: 1
	Compress   bool   `yaml:"compress"`   // gzip old files, default: true
}

type PipelineConfig added in v0.2.0

type PipelineConfig struct {
	BatchSize   int `yaml:"batchSize"`   // default: 1000
	ChannelSize int `yaml:"channelSize"` // default: 10000
}

Jump to

Keyboard shortcuts

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