setting

package
v0.0.0-...-8e399c3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppSetting = &App{}
View Source
var DatabaseSetting = &Database{}
View Source
var RedisSetting = &Redis{}
View Source
var ServerSetting = &Server{}
View Source
var StartTime time.Time
View Source
var TasksSetting = &Tasks{}

Functions

func Setup

func Setup()

Setup initialize the configuration instance

Types

type App

type App struct {
	JwtSecret          string
	JwtExpireTime      time.Duration
	JwtRefreshTime     int64
	JwtHeaderKey       string
	JwtHeaderPrefixKey string
	JwtWsHeaderKey     string
	JwtWhiteLists      []string
	PageSize           int
	MaxPageSize        int
	PrefixUrl          string
	RuntimeRootPath    string
	LogSavePath        string
	LogServerName      string
	LogRequestName     string
	LogFileExt         string
	LogLevel           string
	LogMaxSize         int
	LogMaxBackups      int
	LogMaxAge          int
	LogCompress        bool
	LogConsoleOutput   bool
	LogFileOutput      bool
	AesKey             string
}

func GetAppSetting

func GetAppSetting() *App

type Database

type Database struct {
	Type            string
	User            string
	Password        string
	Host            string
	Port            string
	Db              string
	MaxIdleConns    int
	MaxOpenConns    int
	ConnMaxLifetime time.Duration
	TimeZone        string
	DdFile          string
}

func GetDatabaseSetting

func GetDatabaseSetting() *Database

type Redis

type Redis struct {
	Host        []string
	MasterName  string
	Password    string
	MaxIdle     int
	MaxActive   int
	PoolSize    int
	IdleTimeout time.Duration
}

func GetRedisSetting

func GetRedisSetting() *Redis

type Server

type Server struct {
	RunMode        string
	GinLog         bool
	Ginpprof       bool
	Swagger        bool
	Port           int
	ReadTimeout    time.Duration
	WriteTimeout   time.Duration
	CloseTimeout   time.Duration
	MaxHeaderBytes int
	SSL            bool
	SSLCa          string
	SSLKey         string
}

func GetServerSetting

func GetServerSetting() *Server

type Tasks

type Tasks struct {
	Group         string
	StatusExpires int
	ResultExpires int
	Debug         bool
	NumWorkers    int
}

func GetTasksSetting

func GetTasksSetting() *Tasks

Jump to

Keyboard shortcuts

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