Documentation
¶
Index ¶
Constants ¶
const (
ScaleFactor = 1000000000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityPayload ¶
type ActivityPayload struct {
Online int32
Offline int32
BurstOnline int32
BurstOffline int32
Unresolved int32
}
ActivityPayload is the payload for activity replies (RPY_Activity) https://github.com/mlichvar/chrony/blob/7daf34675a5a2487895c74d1578241ca91a4eb70/candm.h#L685
type ChronyFloat ¶
type ChronyFloat int32
ChronyFloat is 32-bit floating-point format consisting of 7-bit signed exponent and 25-bit signed coefficient without hidden bit. The result is calculated as: 2^(exp - 25) * coef.
func (ChronyFloat) Float64 ¶
func (cf ChronyFloat) Float64() float64
Float64 does magic to decode float from int32. https://github.com/mlichvar/chrony/blob/2ac22477563581ae3bc39c4ff28464059c0a73be/util.c#L900
type ChronyTimespec ¶
ChronyTimespec is the custom chrony timespec type (Timespec) https://github.com/mlichvar/chrony/blob/7daf34675a5a2487895c74d1578241ca91a4eb70/candm.h#L115
func (ChronyTimespec) Time ¶
func (ct ChronyTimespec) Time() time.Time
type Client ¶
func (*Client) Activity ¶
func (c *Client) Activity() (*ActivityPayload, error)
func (*Client) Tracking ¶
func (c *Client) Tracking() (*TrackingPayload, error)
type IPAddr ¶
IPAddr represents IPAddr structure. https://github.com/mlichvar/chrony/blob/7daf34675a5a2487895c74d1578241ca91a4eb70/addressing.h#L41
type TrackingPayload ¶
type TrackingPayload struct {
RefID uint32
Ip IPAddr
Stratum uint16
LeapStatus uint16
RefTime ChronyTimespec
CurrentCorrection ChronyFloat
LastOffset ChronyFloat
RmsOffset ChronyFloat
FreqPpm ChronyFloat
ResidFreqPpm ChronyFloat
SkewPpm ChronyFloat
RootDelay ChronyFloat
RootDispersion ChronyFloat
LastUpdateInterval ChronyFloat
}
TrackingPayload is the payload for tracking replies (RPY_Tracking) https://github.com/mlichvar/chrony/blob/7daf34675a5a2487895c74d1578241ca91a4eb70/candm.h#L581
func (*TrackingPayload) String ¶
func (tp *TrackingPayload) String() string