config

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigYml c.IYmlConfig = c.ConfigYml
View Source
var Server = &Config.Server

Functions

func Init added in v0.0.9

func Init()

Types

type ApplicationSetting

type ApplicationSetting struct {
	Debug     bool   `json:"debug"`
	PageSize  int    `json:"pageSize" yaml:"pageSize"`
	PrefixUrl string `json:"prefixUrl" yaml:"prefixUrl"`

	RuntimeRootPath string

	ImageSavePath  string
	ImageMaxSize   int
	ImageAllowExts []string

	ExportSavePath string
	QrCodeSavePath string
	FontSavePath   string

	LogSavePath string
	LogSaveName string
	LogFileExt  string
	TimeFormat  string
}
var Application *ApplicationSetting = &ApplicationSetting{}

type Configuration

type Configuration struct {
	Server     ServerSetting     `json:"server"`
	FileUpload FileUploadSetting `json:"fileUpload" yaml:"fileUpload"`
}

*

  • 全局配置
var Config *Configuration = &Configuration{}

type FileUploadSetting

type FileUploadSetting struct {
	Size                 int      `json:"size"`
	UploadFileField      string   `json:"uploadFileField" yaml:"uploadFileField"`
	UploadFileSavePath   string   `json:"uploadFileSavePath" yaml:"uploadFileSavePath"`
	UploadFileReturnPath string   `json:"uploadFileReturnPath" yaml:"uploadFileReturnPath"`
	AllowMimeType        []string `json:"allowMimeType" yaml:"allowMimeType"`
}

*

  • 文件上传配置
var FileUpload *FileUploadSetting = &Config.FileUpload

type ServerSetting

type ServerSetting struct {
	BindAddr         string        `json:"bindAddr" yaml:"bindAddr"`
	Port             int           `json:"port"`
	ReadTimeout      time.Duration `json:"readTimeout" yaml:"readTimeout"`
	WriteTimeout     time.Duration `json:"wirteTimeout" yaml:"writeTimeout"`
	AllowCrossDomain bool          `json:"allowCrossDomain" yaml:"allowCrossDomain"`
}

*

  • 服务配置:地址/端口

Jump to

Keyboard shortcuts

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