@@ -60,52 +60,52 @@ func GetDefaultConf() Conf {
60
60
}
61
61
62
62
type Conf struct {
63
- Log Log `toml:"log"`
64
- Server Server `toml:"server"`
65
- Auth Auth `toml:"auth"`
66
- UI UI `toml:"ui"`
67
- CORS CORS `toml:"cors"`
63
+ Log Log `toml:"log" yaml:"log" `
64
+ Server Server `toml:"server" yaml:"server" `
65
+ Auth Auth `toml:"auth" yaml:"auth" `
66
+ UI UI `toml:"ui" yaml:"ui" `
67
+ CORS CORS `toml:"cors" yaml:"cors" `
68
68
}
69
69
70
70
type CORS struct {
71
- Enabled bool `toml:"enabled"`
72
- AllowedOrigins []string `toml:"allowed_origins"`
73
- AllowedMethods []string `toml:"allowed_methods"`
74
- AllowedHeaders []string `toml:"allowed_headers"`
75
- ExposedHeaders []string `toml:"exposed_headers"`
76
- AllowCredentials bool `toml:"allow_credentials"`
71
+ Enabled bool `toml:"enabled" yaml:"enabled" `
72
+ AllowedOrigins []string `toml:"allowed_origins" yaml:"allowed_origins" `
73
+ AllowedMethods []string `toml:"allowed_methods" yaml:"allowed_methods" `
74
+ AllowedHeaders []string `toml:"allowed_headers" yaml:"allowed_headers" `
75
+ ExposedHeaders []string `toml:"exposed_headers" yaml:"exposed_headers" `
76
+ AllowCredentials bool `toml:"allow_credentials" yaml:"allow_credentials" `
77
77
MaxAge int
78
78
}
79
79
80
80
type Server struct {
81
- Host string `toml:"host"`
82
- Port int `toml:"port"`
83
- Path string `toml:"path"`
84
- FsDir string `toml:"fs_dir"`
81
+ Host string `toml:"host" yaml:"host" `
82
+ Port int `toml:"port" yaml:"port" `
83
+ Path string `toml:"path" yaml:"path" `
84
+ FsDir string `toml:"fs_dir" yaml:"fs_dir" `
85
85
}
86
86
87
87
type UI struct {
88
- Enabled bool `toml:"enabled"`
89
- Path string `toml:"path"` // Path prefix. TODO: ui.path cannot equals to server.path
90
- Source string `toml:"source"` // Source location of the UI
88
+ Enabled bool `toml:"enabled" yaml:"enabled" `
89
+ Path string `toml:"path" yaml:"path" ` // Path prefix. TODO: ui.path cannot equals to server.path
90
+ Source string `toml:"source" yaml:"source" ` // Source location of the UI
91
91
}
92
92
93
93
type User struct {
94
- SubPath string `toml:"sub_path"`
95
- SubFsDir string `toml:"sub_fs_dir"`
96
- Username string `toml:"username"`
97
- PasswordHash string `toml:"password_hash"`
98
- PasswordCrypt HashMethond `toml:"password_crypt"`
94
+ SubPath string `toml:"sub_path" yaml:"sub_path" `
95
+ SubFsDir string `toml:"sub_fs_dir" yaml:"sub_fs_dir" `
96
+ Username string `toml:"username" yaml:"username" `
97
+ PasswordHash string `toml:"password_hash" yaml:"password_hash" `
98
+ PasswordCrypt HashMethond `toml:"password_crypt" yaml:"password_crypt" `
99
99
}
100
100
type Auth struct {
101
- User []User `toml:"user"`
101
+ User []User `toml:"user" yaml:"user" `
102
102
}
103
103
104
104
type File struct {
105
- Format LogFormat `toml:"format"`
106
- Path string `toml:"path"`
107
- MaxSize int `toml:"max_size"`
108
- MaxAge int `toml:"max_age"`
105
+ Format LogFormat `toml:"format" yaml:"format" `
106
+ Path string `toml:"path" yaml:"path" `
107
+ MaxSize int `toml:"max_size" yaml:"max_size" `
108
+ MaxAge int `toml:"max_age" yaml:"max_age" `
109
109
}
110
110
111
111
type LogFormat string
@@ -124,11 +124,11 @@ const (
124
124
)
125
125
126
126
type Stdout struct {
127
- Format LogFormat `toml:"format"`
128
- Output LogOutput `toml:"output"`
127
+ Format LogFormat `toml:"format" yaml:"format" `
128
+ Output LogOutput `toml:"output" yaml:"output" `
129
129
}
130
130
type Log struct {
131
- Level string `toml:"level"`
132
- File []File `toml:"file"`
133
- Stdout []Stdout `toml:"stdout"`
131
+ Level string `toml:"level" yaml:"level" `
132
+ File []File `toml:"file" yaml:"file" `
133
+ Stdout []Stdout `toml:"stdout" yaml:"stdout" `
134
134
}
0 commit comments