time

package
v0.0.0-...-e890a9a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeFromNTP

func GetTimeFromNTP(servers []string) (time.Time, error)

func GetTimeFromNTS

func GetTimeFromNTS(servers []string) (time.Time, error)

func GetTimeFromRoughtime

func GetTimeFromRoughtime(servers []RoughtimeServer) (time.Time, error)

GetTimeFromRoughtime queries the given Roughtime servers for the current time. It returns the mean time reported by the servers, or the local time if no servers could be queried successfully.

Types

type RoughtimeServer

type RoughtimeServer struct {
	// Protocol is the network protocol to use (e.g., "udp", "tcp").
	Protocol string
	// Address is the network address of the Roughtime server.
	Address string
	// PublicKey is the base64-encoded public key of the Roughtime server.
	PublicKey string
	// PublicKeyType is the type of the public key (e.g., "ed25519").
	PublicKeyType string
}

RoughtimeServer represents a Roughtime server configuration.

Jump to

Keyboard shortcuts

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