simplify
This commit is contained in:
parent
9a9db972a7
commit
cd94f48b8a
20
config.go
20
config.go
@ -17,15 +17,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
ScheduleDuration map[string]string `json:"schedule"`
|
ScheduleDuration map[string]string `json:"schedule"`
|
||||||
Box map[string]BoxConfig `json:"box"`
|
Box map[string]*BoxConfig `json:"box"`
|
||||||
Email EmailConfig `json:"email"`
|
Email *EmailConfig `json:"email,omitempty"`
|
||||||
Apps []AppConfig `json:"apps"`
|
Apps []*AppConfig `json:"apps"`
|
||||||
Timezone string `json:"timezone"`
|
Timezone string `json:"timezone"`
|
||||||
Admin *AdminConfig `json:"admin"`
|
Admin *AdminConfig `json:"admin"`
|
||||||
box map[string]*Box `json:"-"`
|
box map[string]*Box `json:"-"`
|
||||||
apps map[string]*App `json:"-"`
|
apps map[string]*App `json:"-"`
|
||||||
timezone *time.Location `json:"-"`
|
timezone *time.Location `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -95,7 +95,7 @@ func LoadConfigByte(conf []byte) (*Config, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Email.Active {
|
if c.Email != nil {
|
||||||
if len(c.Email.SmtpHost) == 0 {
|
if len(c.Email.SmtpHost) == 0 {
|
||||||
err := fmt.Errorf("no smtp")
|
err := fmt.Errorf("no smtp")
|
||||||
log.WithFields(log.Fields{"error": err}).Errorf("")
|
log.WithFields(log.Fields{"error": err}).Errorf("")
|
||||||
|
1
email.go
1
email.go
@ -17,7 +17,6 @@ type Email struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type EmailConfig struct {
|
type EmailConfig struct {
|
||||||
Active bool `json:"active"`
|
|
||||||
SmtpHost string `json:"smtp"`
|
SmtpHost string `json:"smtp"`
|
||||||
FromEmail string `json:"email_from"`
|
FromEmail string `json:"email_from"`
|
||||||
ToEmail []string `json:"email_to"`
|
ToEmail []string `json:"email_to"`
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||||
package main
|
package main
|
||||||
var githash = "86da866"
|
var githash = "9a9db97"
|
||||||
var branch = "master"
|
var branch = "master"
|
||||||
var buildstamp = "2024-11-17_15:49:40"
|
var buildstamp = "2024-11-17_16:00:43"
|
||||||
var commits = "93"
|
var commits = "94"
|
||||||
var version = "86da866-b93 - 2024-11-17_15:49:40"
|
var version = "9a9db97-b94 - 2024-11-17_16:00:43"
|
||||||
|
Loading…
Reference in New Issue
Block a user