setting

package
v0.0.0-...-61dbfe3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppConfigSetting = &AppConfig{}
View Source
var DBEngine *gorm.DB

Functions

func Setup

func Setup()

Setup initialize the configuration instance

Types

type App

type App struct {
	JwtSecret string `yaml:"jwtSecret"`
	PageSize  int    `yaml:"pageSize"`
	PrefixUrl string `yaml:"prefixUrl"`

	RuntimeRootPath string `yaml:"runtimeRootPath"`

	ImageSavePath  string   `yaml:"imageSavePath"`
	ImageMaxSize   int      `yaml:"imageMaxSize"`
	ImageAllowExts []string `yaml:"imageAllowExts"`

	ExportSavePath string `yaml:"exportSavePath"`
	QrCodeSavePath string `yaml:"qrCodeSavePath"`
	FontSavePath   string `yaml:"fontSavePath"`

	LogSavePath string `yaml:"logSavePath"`
	LogSaveName string `yaml:"logSaveName"`
	LogFileExt  string `yaml:"logFileExt"`
	TimeFormat  string `yaml:"timeFormat"`

	LuaSeckillPath string `yaml:"luaSeckillPath"`
}

type AppConfig

type AppConfig struct {
	App      App      `yaml:"app"`
	Server   Server   `yaml:"server"`
	Casbin   Casbin   `yaml:"casbin"`
	Database Database `yaml:"database"`
}

type Casbin

type Casbin struct {
	ModelPath string `yaml:"modelPath"`
}

type Database

type Database struct {
	Mysql Mysql `yaml:"mysql"`
	Redis Redis `yaml:"redis"`
}

type Mysql

type Mysql struct {
	Type     string `yaml:"type"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	DbName   string `yaml:"dbName"`
	Host     string `yaml:"host"`
	MaxIdle  int    `yaml:"maxIdle"`
	MaxOpen  int    `yaml:"maxOpen"`
}

type Redis

type Redis struct {
	Host        string        `yaml:"host"`
	Network     string        `yaml:"network"`
	Password    string        `yaml:"password"`
	Database    int           `yaml:"database"`
	MaxIdle     int           `yaml:"maxIdle"`
	MaxActive   int           `yaml:"maxActive"`
	IdleTimeout time.Duration `yaml:"idelTimeout"`
}

type Server

type Server struct {
	RunMode      string        `yaml:"runMode"`
	HttpPort     int           `yaml:"httpPort"`
	ReadTimeout  time.Duration `yaml:"readTimeout"`
	WriteTimeout time.Duration `yaml:"writeTimeout"`
}

Jump to

Keyboard shortcuts

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