clock

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package clock wraps clock sources.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNTP

func NewNTP(ntpHost ...string) (clock.Clock, error)

NewNTP creates new NTP clock.

Example
package main

import (
	"log"

	"github.com/gotd/contrib/clock"
	"github.com/gotd/td/telegram"
)

func main() {
	c, err := clock.NewNTP() // or clock.NewNTP("my.ntp.host")
	if err != nil {
		log.Fatal(err)
	}

	client, err := telegram.ClientFromEnvironment(telegram.Options{
		Clock: c,
	})
	if err != nil {
		log.Fatal(err)
	}

	_ = client
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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