config.go 3.6 KB
Newer Older
1 2 3
package config

type Server struct {
G
Granty1 已提交
4 5 6 7 8 9 10 11 12
	Mysql     Mysql     `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	Sqlite    Sqlite    `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
	Qiniu     Qiniu     `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
	Casbin    Casbin    `mapstructure:"casbin" json:"casbin" yaml:"casbin"`
	Redis     Redis     `mapstructure:"redis" json:"redis" yaml:"redis"`
	System    System    `mapstructure:"system" json:"system" yaml:"system"`
	JWT       JWT       `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
	Captcha   Captcha   `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
	Log       Log       `mapstructure:"log" json:"log" yaml:"log"`
13
	LocalUpload LocalUpload `mapstructure:"localUpload" json:"localUpload" yaml:"localUpload"`
14 15
}

16
type System struct {
17 18 19 20
	UseMultipoint bool   `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"`
	Env           string `mapstructure:"env" json:"env" yaml:"env"`
	Addr          int    `mapstructure:"addr" json:"addr" yaml:"addr"`
	DbType        string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
21 22
}

23
type JWT struct {
24
	SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"`
25 26
}

27
type Casbin struct {
28
	ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
29 30
}

31
type Mysql struct {
32 33 34 35 36 37 38 39
	Username     string `mapstructure:"username" json:"username" yaml:"username"`
	Password     string `mapstructure:"password" json:"password" yaml:"password"`
	Path         string `mapstructure:"path" json:"path" yaml:"path"`
	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
	Config       string `mapstructure:"config" json:"config" yaml:"config"`
	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
	LogMode      bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
40 41
}

42
type Redis struct {
43 44 45
	Addr     string `mapstructure:"addr" json:"addr" yaml:"addr"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	DB       int    `mapstructure:"db" json:"db" yaml:"db"`
46
}
47 48 49 50 51 52 53

type LocalUpload struct {
	Local bool `mapstructure:"local" json:"local" yaml:"local"`
	AvatarPath string `mapstructure:"avatar-path" json:"avatarPath" yaml:"avatar-path"`
	FilePath string `mapstructure:"file-path" json:"filePath" yaml:"file-path"`
}

54
type Qiniu struct {
55 56
	AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`
	SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
L
Leonard Wang 已提交
57 58
	Bucket    string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
	ImgPath   string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
59 60
}

61
type Captcha struct {
62 63 64
	KeyLong   int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`
	ImgWidth  int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`
	ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
65 66 67
}

type Log struct {
68 69 70 71
	Prefix  string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
	LogFile bool   `mapstructure:"log-file" json:"logFile" yaml:"log-file"`
	Stdout  string `mapstructure:"stdout" json:"stdout" yaml:"stdout"`
	File    string `mapstructure:"file" json:"file" yaml:"file"`
72
}
R
rikugun 已提交
73 74

type Sqlite struct {
75 76 77 78 79
	Username string `mapstructure:"username" json:"username" yaml:"username"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	Path     string `mapstructure:"path" json:"path" yaml:"path"`
	Config   string `mapstructure:"config" json:"config" yaml:"config"`
	LogMode  bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
R
rikugun 已提交
80
}