timesrc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NTPTimeSource

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

NTPTimeSource is a time source which uses a NTP server.

func NewNTPTimeSource

func NewNTPTimeSource(ntpServer string) *NTPTimeSource

NewNTPTimeSource creates a new TimeSource using the given NTP server.

func (*NTPTimeSource) Time

func (ntpTimeSource *NTPTimeSource) Time() (time.Time, error)

type SystemClock

type SystemClock struct{}

SystemClock is a TimeSource which uses the system clock.

func (*SystemClock) Time

func (rc *SystemClock) Time() (time.Time, error)

type TimeSource

type TimeSource interface {
	Time() (time.Time, error)
}

TimeSource defines a source of time.

Jump to

Keyboard shortcuts

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