ntp

package
v0.0.0-...-91df8d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRemotePort = 123
	DefaultLocalPort  = 2390
	DefaultTZOffset   = -6 * 60 * 60 // CST(-6)
	DefaultInterval   = 6 * time.Hour
	DefaultPrecision  = time.Second
	DefaultLeapSmear  = false // ** only if using Google NTP (time.google.com) **
)

Variables

View Source
var (
	ErrReadDatagramSize = errors.New("received unexpected NTP datagram size")
	ErrReadNoResponse   = errors.New("timeout waiting for NTP datagram reply")
)
View Source
var DefaultServer = []string{"us.pool.ntp.org", "time.google.com"}

Functions

This section is empty.

Types

type Config

type Config struct {
	Server     []string
	RemotePort int
	LocalPort  int
	TZOffset   int
	Interval   time.Duration // how often to synchronize with NTP server
	Precision  time.Duration // how often to update Model with synchronized time
	LeapSmear  bool          // https://developers.google.com/time/faq#libit
}

type NTP

type NTP struct {
	// contains filtered or unexported fields
}

func New

func New(device *wifi.WiFi, config Config) *NTP

func (*NTP) Sync

func (n *NTP) Sync() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL