ntpdshm

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Leap

type Leap int

Leap is a leap second indicator.

const (
	// LeapNoWarning indicates no leap second.
	LeapNoWarning Leap = 0

	// LeapAddSecond indicates a positive leap second.
	LeapAddSecond Leap = 1

	// LeapDelSecond indicates a negative leap second.
	LeapDelSecond Leap = 2

	// LeapNotInSync indicates a leap second.
	LeapNotInSync Leap = 3
)

func (Leap) String

func (l Leap) String() string

type SHM

type SHM struct {
	// contains filtered or unexported fields
}

SHM the shared-memory-segment of NTPD.

func Get

func Get(units uint) (*SHM, error)

Get gets the shared-memory-segment of NTPD.

func (*SHM) ClockTimeStamp

func (shm *SHM) ClockTimeStamp() time.Time

ClockTimeStamp returns the clock timestamp.

func (*SHM) Count

func (shm *SHM) Count() int32

Count returns the count.

func (*SHM) IncrCount

func (shm *SHM) IncrCount()

IncrCount increments the count.

func (*SHM) Leap

func (shm *SHM) Leap() Leap

Leap returns the leap indicator.

func (*SHM) Lock

func (shm *SHM) Lock()

Lock locks the SHM.

func (*SHM) Mode

func (shm *SHM) Mode() int32

Mode returns the mode. 0 - if valid is set: use values, clear valid. 1 - if valid is set: if count before and after read of data is equal: use values, clear valid.

func (*SHM) NSamples

func (shm *SHM) NSamples() int32

NSamples returns the number of samples.

func (*SHM) Precision

func (shm *SHM) Precision() int32

Precision returns the precision.

func (*SHM) ReceiveTimeStamp

func (shm *SHM) ReceiveTimeStamp() time.Time

ReceiveTimeStamp returns the receive timestamp.

func (*SHM) SetClockTimeStamp

func (shm *SHM) SetClockTimeStamp(t time.Time)

SetClockTimeStamp sets the clock timestamp.

func (*SHM) SetCount

func (shm *SHM) SetCount(count int32)

SetCount sets the count.

func (*SHM) SetLeap

func (shm *SHM) SetLeap(leap Leap)

SetLeap sets the leap indicator.

func (*SHM) SetMode

func (shm *SHM) SetMode(mode int32)

SetMode set the mode.

func (*SHM) SetNSamples

func (shm *SHM) SetNSamples(nsamples int32)

SetNSamples sets the number of samples.

func (*SHM) SetPrecision

func (shm *SHM) SetPrecision(precision int32)

SetPrecision sets the precision.

func (*SHM) SetReceiveTimeStamp

func (shm *SHM) SetReceiveTimeStamp(t time.Time)

SetReceiveTimeStamp sets the receive timestamp.

func (*SHM) SetValid

func (shm *SHM) SetValid(valid bool)

SetValid sets whether the SHM is valid.

func (*SHM) Unlock

func (shm *SHM) Unlock()

Unlock unlocks the SHM.

func (*SHM) Valid

func (shm *SHM) Valid() bool

Valid returns whether the SHM is valid.

Jump to

Keyboard shortcuts

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