2021-09-17 04:44:35 +00:00
|
|
|
package schema
|
|
|
|
|
2022-03-02 06:40:26 +00:00
|
|
|
import (
|
2023-05-07 06:39:17 +00:00
|
|
|
"net/url"
|
2022-03-02 06:40:26 +00:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2021-09-17 04:44:35 +00:00
|
|
|
// NTPConfiguration represents the configuration related to ntp server.
|
|
|
|
type NTPConfiguration struct {
|
2023-05-07 06:39:17 +00:00
|
|
|
Address *AddressUDP `koanf:"address"`
|
2022-03-02 06:40:26 +00:00
|
|
|
Version int `koanf:"version"`
|
|
|
|
MaximumDesync time.Duration `koanf:"max_desync"`
|
|
|
|
DisableStartupCheck bool `koanf:"disable_startup_check"`
|
|
|
|
DisableFailure bool `koanf:"disable_failure"`
|
2021-09-17 04:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultNTPConfiguration represents default configuration parameters for the NTP server.
|
|
|
|
var DefaultNTPConfiguration = NTPConfiguration{
|
2023-05-07 06:39:17 +00:00
|
|
|
Address: &AddressUDP{Address{valid: true, socket: false, port: 123, url: &url.URL{Scheme: AddressSchemeUDP, Host: "time.cloudflare.com:123"}}},
|
2021-09-17 04:44:35 +00:00
|
|
|
Version: 4,
|
2022-03-02 06:40:26 +00:00
|
|
|
MaximumDesync: time.Second * 3,
|
2021-09-17 04:44:35 +00:00
|
|
|
}
|