clock

package
v0.0.0-...-d21987e Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 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/td/telegram"
	"github.com/t2bot/gotd-contrib/clock"
)

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