Node_Exporter/vendor/github.com/beevik/ntp/README.md

26 lines
962 B
Markdown
Raw Normal View History

[![Build Status](https://travis-ci.org/beevik/ntp.svg?branch=master)](https://travis-ci.org/beevik/ntp)
[![GoDoc](https://godoc.org/github.com/beevik/ntp?status.svg)](https://godoc.org/github.com/beevik/ntp)
ntp
===
The ntp package is an implementation of a Simple NTP (SNTP) client based on
[RFC5905](https://tools.ietf.org/html/rfc5905). It allows you to connect to
a remote NTP server and request the current time.
If all you care about is the current time according to a known remote NTP
server, simply use the `Time` function:
2017-02-28 22:59:37 +01:00
```go
time, err := ntp.Time("0.beevik-ntp.pool.ntp.org")
2017-02-28 22:59:37 +01:00
```
If you want the time as well as additional metadata about the time, use the
`Query` function instead:
2017-02-28 22:59:37 +01:00
```go
response, err := ntp.Query("0.beevik-ntp.pool.ntp.org")
2017-02-28 22:59:37 +01:00
```
To use the NTP pool in your application, please request your own
[vendor zone](http://www.pool.ntp.org/en/vendors.html). Avoid using
the `[number].pool.ntp.org` zone names in your applications.