Documentation
¶
Index ¶
Constants ¶
View Source
const ( // 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 ( // Now is just an alias to time.Now. Now = time.Now // ParseDuration is just an alias to time.ParseDuration. ParseDuration = time.ParseDuration // Since is just an alias to time.Since. Since = time.Since // Sleep is just an alias to time.Sleep. Sleep = time.Sleep )
View Source
var ErrNotFound = errors.New("time: network not found")
ErrNotFound for metrics.
View Source
var Module = fx.Options( fx.Provide(NewNetwork), )
Module for fx.
Functions ¶
func MustParseDuration ¶ added in v1.150.0
MustParseDuration for time.
Types ¶
type Config ¶ added in v1.176.0
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 NTPNetwork ¶ added in v1.518.0
type NTPNetwork struct {
// contains filtered or unexported fields
}
NTPNetwork implements the Network interface for NTP.
func NewNTPNetwork ¶ added in v1.518.0
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 ¶ added in v1.518.0
func (n *NTPNetwork) Now() (Time, error)
Now returns the current time from the NTP server.
type NTSNetwork ¶ added in v1.518.0
type NTSNetwork struct {
// contains filtered or unexported fields
}
NTSNetwork implements the Network interface for NTS.
func NewNTSNetwork ¶ added in v1.518.0
func NewNTSNetwork(address string) *NTSNetwork
NewNTSNetwork creates a new NTS network with an address. https://datatracker.ietf.org/doc/html/rfc8915
func (*NTSNetwork) Now ¶ added in v1.518.0
func (n *NTSNetwork) Now() (Time, error)
Now returns the current time from the NTS server.
type Network ¶ added in v1.179.0
Network for time.
func NewNetwork ¶ added in v1.179.0
NewNetwork for time.
Click to show internal directories.
Click to hide internal directories.