config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	RefreshTokenTtl int    `mapstructure:"refresh_token_ttl"`
	AccessTokenTtl  int    `mapstructure:"access_token_ttl"`
	HmacSecret      string `mapstructure:"hmac_secret"`
}

AuthConfig 认证配置(Admin 和 Api 共用字段)

type CorsConfig

type CorsConfig struct {
	AllowOrigins     []string `mapstructure:"allow_origins"`
	AllowMethods     []string `mapstructure:"allow_methods"`
	AllowHeaders     []string `mapstructure:"allow_headers"`
	AllowCredentials bool     `mapstructure:"allow_credentials"`
}

CorsConfig 跨域配置

type FileLogConfig

type FileLogConfig struct {
	Path       string `mapstructure:"path"`
	Filename   string `mapstructure:"filename"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxAge     int    `mapstructure:"max_age"`
	MaxBackups int    `mapstructure:"max_backups"`
	Compress   bool   `mapstructure:"compress"`
	LocalTime  bool   `mapstructure:"local_time"`
}

FileLogConfig 文件日志配置

type LoggerConfig

type LoggerConfig struct {
	Level   string        `mapstructure:"level"`
	Writers []string      `mapstructure:"writers"`
	File    FileLogConfig `mapstructure:"file"`
}

LoggerConfig 日志配置

type MongoDBConfig

type MongoDBConfig struct {
	URI      string `mapstructure:"uri"`
	Database string `mapstructure:"database"`
	Enabled  bool   `mapstructure:"enabled"`
}

MongoDBConfig MongoDB配置

type MySQLConfig

type MySQLConfig struct {
	Dsn    string `mapstructure:"dsn"`
	Prefix string `mapstructure:"prefix"`
}

MySQLConfig MySQL配置

type RedisConfig

type RedisConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`
}

RedisConfig Redis配置

type ServerConfig

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

ServerConfig 服务配置

Jump to

Keyboard shortcuts

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