clockboundclient

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 5 Imported by: 1

README

main

clockbound-client-go

A Go client for AWS ClockBound using the newer ClockBound Shared Memory Protocol Version 1. Only tested on Linux on little endian CPU architecture.

The ClockBound daemon must be running in order to use this library.

Check out the provided example code on how to use the client.

Documentation

Index

Constants

View Source
const DefaultShmPath = "/var/run/clockbound/shm"

Variables

View Source
var ClockStatusName = map[ClockStatus]string{
	ClockStatusUnknown:      "UNKNOWN",
	ClockStatusSynchronized: "SYNCHRONIZED",
	ClockStatusFreeRunning:  "FREE_RUNNING",
}

Functions

This section is empty.

Types

type Client

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

Client represents a connection to ClockBound's shared memory file.

func New

func New() (*Client, error)

New creates an instance of Client.

func (*Client) Close

func (c *Client) Close() error

Close releases the opened and memory-mapped file.

func (*Client) Error

func (c *Client) Error() string

Error implements the `error` interface, returning the internal error.

func (*Client) Now

func (c *Client) Now() (Now, error)

Now gets a set range of bounded timestamps from ClockBound.

type ClockStatus

type ClockStatus int
const (
	ClockStatusUnknown ClockStatus = iota
	ClockStatusSynchronized
	ClockStatusFreeRunning
)

func (ClockStatus) String added in v0.1.2

func (cs ClockStatus) String() string

type Now

type Now struct {
	Earliest time.Time
	Latest   time.Time
	Status   ClockStatus
}

Now represents a range of bounded timestamp from ClockBound. The "true" time is somewhere within the range.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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