Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Hour is an alias of time.Hour. Hour = time.Hour // Microsecond is an alias of time.Microsecond. Microsecond = time.Microsecond // Millisecond is an alias of time.Millisecond. Millisecond = time.Millisecond // Minute is an alias of time.Minute. Minute = time.Minute // Nanosecond is an alias of time.Nanosecond. Nanosecond = time.Nanosecond // Second is an alias of time.Second. Second = time.Second // RFC3339 is an alias of time.RFC3339. RFC3339 = time.RFC3339 )
Variables ¶
View Source
var ErrNotFound = errors.New("time: network not found")
ErrNotFound for metrics.
View Source
var Module = di.Module( di.Constructor(NewNetwork), )
Module for fx.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Kind string `yaml:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"`
Address string `yaml:"address,omitempty" json:"address,omitempty" toml:"address,omitempty"`
}
Config for time.
type Duration ¶
Duration is an alias of time.Duration.
func ParseDuration ¶
ParseDuration is just an alias to time.ParseDuration.
type NTPNetwork ¶
type NTPNetwork struct {
// contains filtered or unexported fields
}
NTPNetwork implements the Network interface for NTP.
func NewNTPNetwork ¶
func NewNTPNetwork(address string) *NTPNetwork
NewNTPNetwork creates a new NTP network with an address. https://en.wikipedia.org/wiki/Network_Time_Protocol
func (*NTPNetwork) Now ¶
func (n *NTPNetwork) Now() (Time, error)
Now returns the current time from the NTP server.
type NTSNetwork ¶
type NTSNetwork struct {
// contains filtered or unexported fields
}
NTSNetwork implements the Network interface for NTS.
func NewNTSNetwork ¶
func NewNTSNetwork(address string) *NTSNetwork
NewNTSNetwork creates a new NTS network with an address. https://datatracker.ietf.org/doc/html/rfc8915
func (*NTSNetwork) Now ¶
func (n *NTSNetwork) Now() (Time, error)
Now returns the current time from the NTS server.
Click to show internal directories.
Click to hide internal directories.