cleanup and add a few stuff for http

This commit is contained in:
shoopea
2024-11-17 15:14:36 +01:00
parent 26c324c43c
commit e1806fd27a
14 changed files with 123 additions and 114 deletions

View File

@@ -37,10 +37,9 @@ var (
var sampleCfg []byte
type BoxConfig struct {
Addr string `json:"addr"`
User string `json:"user"`
Key string `json:"key"`
AllowDirectConnect bool `json:"allow_direct_connect"`
Addr string `json:"addr"`
User string `json:"user"`
Key string `json:"key"`
}
type AppConfig struct {
@@ -136,7 +135,7 @@ func LoadConfigByte(conf []byte) (*Config, error) {
c.box = make(map[string]*Box)
for k, v := range c.Box {
if b, err := c.NewBox(k, v.Addr, v.User, v.Key, v.AllowDirectConnect); err != nil {
if b, err := c.NewBox(k, v.Addr, v.User, v.Key); err != nil {
log.WithFields(log.Fields{"call": "NewBox", "attr": k, "error": err}).Errorf("")
return nil, err
} else {
@@ -282,6 +281,4 @@ func (c *Config) Run() {
log.WithFields(log.Fields{"call": "email.Send", "error": err}).Errorf("")
}
}
return
}