config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort       = 8000
	DefaultConfigName = "config"
	DefaultConfigType = "toml"

	ServerPortKey = "server.port"
)

Variables

This section is empty.

Functions

func SetLogLevelChangeListener added in v0.4.0

func SetLogLevelChangeListener(listener func(level string))

Types

type AuthConfig

type AuthConfig struct {
	UploaderValidationURL string `mapstructure:"uploader_validation_url"`
	CDKValidationURL      string `mapstructure:"cdk_validation_url"`
}

type BillingConfig added in v0.2.0

type BillingConfig struct {
	CheckinURL string `mapstructure:"billing_checkin_url"`
}

type Config

type Config struct {
	Server   ServerConfig   `mapstructure:"server"`
	Log      LogConfig      `mapstructure:"log"`
	Registry Registration   `mapstructure:"registry"`
	Database DatabaseConfig `mapstructure:"database"`
	Auth     AuthConfig     `mapstructure:"auth"`
	Billing  BillingConfig  `mapstructure:"billing"`
	Redis    RedisConfig    `mapstructure:"redis"`
	Extra    ExtraConfig    `mapstructure:"extra"`
}
var (
	CFG *Config
)

func New

func New() *Config

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `mapstructure:"host"`
	Port     string `mapstructure:"port"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Name     string `mapstructure:"name"`
}

type ExtraConfig added in v0.2.0

type ExtraConfig struct {
	DownloadPrefix        []string      `mapstructure:"download_prefix"`
	DownloadEffectiveTime time.Duration `mapstructure:"download_effective_time"`
	SqlDebugMode          bool          `mapstructure:"sql_debug_mode"`
}

type LogConfig

type LogConfig struct {
	Level      string `mapstructure:"level"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxBackups int    `mapstructure:"max_backups"`
	MaxAge     int    `mapstructure:"max_age"`
	Compress   bool   `mapstructure:"compress"`
}

type RedisConfig added in v0.2.0

type RedisConfig struct {
	Addr     string `mapstructure:"addr"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Name     string `mapstructure:"name"`
	DB       int    `mapstructure:"db"`
}

type Registration added in v0.4.0

type Registration struct {
	Host        string `mapstructure:"host"`
	Port        uint64 `mapstructure:"port"`
	GrpcPort    uint64 `mapstructure:"grpc_port"`
	NamespaceId string `mapstructure:"namespace_id"`
	Group       string `mapstructure:"group"`
	DataId      string `mapstructure:"data_id"`
	Username    string `mapstructure:"username"`
	Password    string `mapstructure:"password"`
}

type ServerConfig

type ServerConfig struct {
	Port int `mapstructure:"port"`
}

Jump to

Keyboard shortcuts

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