Documentation ¶
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"` // ResponsesBufferSize should be updated from p2pconfig.BufferSize ResponsesBufferSize int }
Config for Sync.
type Network ¶
type Network interface { RegisterDirectProtocolWithChannel(protocol string, ingressChannel chan service.DirectMessage) chan service.DirectMessage SendWrappedMessage(ctx context.Context, nodeID p2pcrypto.PublicKey, protocol string, payload *service.DataMsgWrapper) error SubscribePeerEvents() (added, expired chan p2pcrypto.PublicKey) }
Network ...
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 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.