26 lines
555 B
Go
26 lines
555 B
Go
|
package config
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/rs/zerolog"
|
||
|
)
|
||
|
|
||
|
// Config represents application's configuration.
|
||
|
type Config struct {
|
||
|
DirectAdmin DirectAdminConfig `envPrefix:"DA_"`
|
||
|
Domain DomainConfig `envPrefix:"DOMAIN_"`
|
||
|
ResyncTime time.Duration `env:"RESYNC_TIME" envDefault:"15m"`
|
||
|
}
|
||
|
|
||
|
// MarshalZerologObject implements zerolog.LogObjectMarshaler.
|
||
|
func (c *Config) MarshalZerologObject(e *zerolog.Event) {
|
||
|
e.
|
||
|
Object("directAdmin", &c.DirectAdmin).
|
||
|
Object("domain", &c.Domain)
|
||
|
}
|
||
|
|
||
|
var (
|
||
|
_ zerolog.LogObjectMarshaler = &Config{}
|
||
|
)
|