Documentation ¶
Overview ¶
nolint
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPeersNotSynced returned if system clock is out of sync with peers clock for configured period of time. ErrPeersNotSynced = errors.New("timesync: peers are not time synced") // ErrTimesyncFailed returned if we weren't able to collect enough clock samples from peers. ErrTimesyncFailed = errors.New("timesync: failed request") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Disable bool `mapstructure:"disable"` RoundRetryInterval time.Duration `mapstructure:"round-retry-interval"` RoundInterval time.Duration `mapstructure:"round-interval"` RoundTimeout time.Duration `mapstructure:"round-timeout"` MaxClockOffset time.Duration `mapstructure:"max-clock-offset"` MaxOffsetErrors int `mapstructure:"max-offset-errors"` RequiredResponses int `mapstructure:"required-responses"` }
Config for Sync.
type Option ¶
type Option func(*Sync)
Option to modify Sync behavior.
func WithContext ¶
WithContext modifies parent context that is used for all operations in Sync.
type Request ¶
type Request struct {
ID uint64
}
Request is a sync request.
func (*Request) DecodeScale ¶
func (*Request) EncodeScale ¶
type Response ¶
Response is a sync response.
func (*Response) DecodeScale ¶
func (*Response) EncodeScale ¶
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
Sync manages background worker that compares peers time with system time.
Click to show internal directories.
Click to hide internal directories.