ip-ddns/config/config.go

26 lines
555 B
Go
Raw Normal View History

2023-11-17 07:20:10 +01:00
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{}
)