setting

package
v0.0.0-...-76b4d0c Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppSetting = &App{}

AppSetting APP 配置

View Source
var DatabaseSetting = &Database{}

DatabaseSetting 数据库配置

View Source
var RedisSetting = &Redis{}

RedisSetting Redis 缓存

View Source
var ServerSetting = &Server{}

ServerSetting 服务器配置

Functions

func Setup

func Setup()

Setup 初始化各项配置

Types

type App

type App struct {
	Debug           bool
	JwtSecret       string
	PageSize        int
	RuntimeRootPath string

	PrefixUrl      string
	ImageSavePath  string
	ImageMaxSize   int
	ImageAllowExts []string

	ExportSavePath string
	QrCodeSavePath string
	FontSavePath   string
	LogSavePath    string
	LogSaveName    string
	LogFileExt     string
	TimeFormat     string
}

type Database

type Database struct {
	Type        string
	User        string
	Password    string
	Host        string
	Name        string
	TablePrefix string
	LogMode     bool
}

type Redis

type Redis struct {
	Host     string
	Password string
	// 最大空闲连接数
	MaxIdle int
	// 在给定时间内,允许分配的最大连接数(当为零时,没有限制)
	MaxActive int
	// 在给定时间内将会保持空闲状态,若到达时间限制则关闭连接(当为零时,没有限制)
	IdleTimeout time.Duration
}

type Server

type Server struct {
	RunMode      string
	HttpPort     int
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

Jump to

Keyboard shortcuts

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