gin-blog/pkg/setting/section.go

61 lines
1.0 KiB
Go
Raw Permalink Normal View History

2021-05-28 10:41:12 +00:00
package setting
import "time"
type ServerSettingS struct {
RunMode string
HttpPort string
ReadTimeout time.Duration
WriteTimeout time.Duration
}
2021-05-31 09:40:47 +00:00
type JWT struct {
Secret string
Issuer string
Expire time.Duration
}
2021-05-28 10:41:12 +00:00
type AppSettingS struct {
DefaultPageSize int
MaxPageSize int
LogSavePath string
LogFileName string
LogFileExt string
UploadSavePath string
UploadServerUrl string
UploadImageMaxSize int
UploadImageAllowExts []string
}
type DatabaseSettingS struct {
DBType string
UserName string
Password string
Host string
DBName string
TablePrefix string
Charset string
ParseTime bool
MaxIdleConns int
MaxOpenConns int
}
func (s *Setting) ReadSection(k string, v interface{}) error {
err := s.vp.UnmarshalKey(k, v)
if err != nil {
return err
}
return nil
}
type EmailSettingS struct {
Host string
Port int
UserName string
Password string
IsSSL bool
From string
To []string
}