-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
97 lines (84 loc) · 1.5 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package logger
// Config 日志配置
type Config struct {
Out string `json:"out,omitempty"`
Level string `json:"level,omitempty"`
File *File `json:"file,omitempty"`
Type string `json:"type,omitempty"`
// 默认:0-default, 1-simple
Model int32 `json:"model,omitempty"`
}
func (x *Config) GetOut() string {
if x != nil {
return x.Out
}
return ""
}
func (x *Config) GetLevel() string {
if x != nil {
return x.Level
}
return ""
}
func (x *Config) GetFile() *File {
if x != nil {
return x.File
}
return nil
}
func (x *Config) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *Config) GetModel() int32 {
if x != nil {
return x.Model
}
return 0
}
type File struct {
Path string `json:"path,omitempty"`
FileName string `json:"file_name,omitempty"`
MaxSize int32 `json:"max_size,omitempty"`
MaxBackups int32 `json:"max_backups,omitempty"`
MaxAge int32 `json:"max_age,omitempty"`
Compress bool `json:"compress,omitempty"`
}
func (x *File) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
func (x *File) GetFileName() string {
if x != nil {
return x.FileName
}
return ""
}
func (x *File) GetMaxSize() int32 {
if x != nil {
return x.MaxSize
}
return 0
}
func (x *File) GetMaxBackups() int32 {
if x != nil {
return x.MaxBackups
}
return 0
}
func (x *File) GetMaxAge() int32 {
if x != nil {
return x.MaxAge
}
return 0
}
func (x *File) GetCompress() bool {
if x != nil {
return x.Compress
}
return false
}