ntpsync

package module
v0.0.0-...-e3067e5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now() time.Time

Now returns ntp time using the DefaultClient or just the localhost time.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}
var DefaultClient *Client

DefaultClient variable when set by the user to a non-nil value will make Now to use time from that particular ntp server.

func New

func New(ctx context.Context, server string) (*Client, error)

New creates an NTP client using the given NTP server.

func (*Client) Close

func (s *Client) Close()

Close stops the NTP server.

func (*Client) Now

func (s *Client) Now(ctx context.Context) (time.Time, error)

Now queries the NTP server and returns the ntp time.

Jump to

Keyboard shortcuts

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