config

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultPort = 8000

Variables

This section is empty.

Functions

This section is empty.

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"`
	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 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