timestamp

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package timestamp is a generated protocol buffer package.

It is generated from these files:

timestamp.proto

It has these top-level messages:

Timestamp

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxTimestamp is the max value allowed for Timestamp.
	// Timestamp{WallTime: math.MaxInt64, Logical: math.MaxInt32} is reversed for internal usage
	MaxTimestamp = Timestamp{WallTime: math.MaxInt64 - 1, Logical: math.MaxInt32}
	// MinTimestamp is the min value allowed for Timestamp.
	MinTimestamp = Timestamp{WallTime: 0, Logical: 1}
)

Timestamp constant values.

View Source
var (
	ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTimestamp   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type Timestamp

type Timestamp struct {
	// Holds a wall time, typically a unix epoch time
	// expressed in nanoseconds.
	WallTime int64 `protobuf:"varint,1,opt,name=wall_time,json=wallTime,proto3" json:"wall_time,omitempty"`
	// The logical component captures causality for events whose wall
	// times are equal. It is effectively bounded by (maximum clock
	// skew)/(minimal ns between events) and nearly impossible to
	// overflow.
	Logical int32 `protobuf:"varint,2,opt,name=logical,proto3" json:"logical,omitempty"`
}

Timestamp represents a state of the hybrid logical clock.

func (Timestamp) Add

func (t Timestamp) Add(wallTime int64, logical int32) Timestamp

Add returns a timestamp with the WallTime and Logical components increased. wallTime is expressed in nanos.

func (*Timestamp) Backward

func (t *Timestamp) Backward(s Timestamp)

Backward updates the timestamp from the one given, if that moves it backwards in time.

func (*Timestamp) Descriptor

func (*Timestamp) Descriptor() ([]byte, []int)

func (Timestamp) Equal

func (t Timestamp) Equal(s Timestamp) bool

Equal check equal

func (*Timestamp) Forward

func (t *Timestamp) Forward(s Timestamp) bool

Forward updates the timestamp from the one given, if that moves it forwards in time. Returns true if the timestamp was adjusted and false otherwise.

func (*Timestamp) GetLogical

func (m *Timestamp) GetLogical() int32

func (*Timestamp) GetWallTime

func (m *Timestamp) GetWallTime() int64

func (Timestamp) GoTime

func (t Timestamp) GoTime() time.Time

GoTime converts the timestamp to a time.Time.

func (Timestamp) Less

func (t Timestamp) Less(s Timestamp) bool

Less compares two timestamps.

func (Timestamp) LessOrEqual

func (t Timestamp) LessOrEqual(s Timestamp) bool

LessOrEqual compares two timestamps.

func (*Timestamp) Marshal

func (m *Timestamp) Marshal() (dAtA []byte, err error)

func (*Timestamp) MarshalTo

func (m *Timestamp) MarshalTo(dAtA []byte) (int, error)

func (Timestamp) Next

func (t Timestamp) Next() Timestamp

Next returns the timestamp with the next later timestamp.

func (Timestamp) Prev

func (t Timestamp) Prev() Timestamp

Prev returns the next earliest timestamp.

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) Reset

func (m *Timestamp) Reset()

func (*Timestamp) Size

func (m *Timestamp) Size() (n int)

func (*Timestamp) String

func (m *Timestamp) String() string

func (Timestamp) TString

func (t Timestamp) TString() string

func (*Timestamp) Unmarshal

func (m *Timestamp) Unmarshal(dAtA []byte) error

func (Timestamp) Valid

func (t Timestamp) Valid() bool

Valid check valid

Jump to

Keyboard shortcuts

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