timestamp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Timestamp

type Timestamp struct {
	// PhysicalTime is the physical component of the HLC, it is read from a node's
	// wall clock time as Unix epoch time in nanoseconds. HLC requires this field
	// to be monotonically increase on each node.
	PhysicalTime int64 `protobuf:"varint,1,opt,name=PhysicalTime,proto3" json:"PhysicalTime,omitempty"`
	// LogicalTime is the logical component of the HLC, its value is maintained
	// according to the HLC algorithm. The HLC paper further establishes that its
	// value will not overflow in a real production environment.
	LogicalTime          uint32   `protobuf:"varint,2,opt,name=LogicalTime,proto3" json:"LogicalTime,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Timestamp is a HLC time value. All its field should never be accessed directly by its users.

func (*Timestamp) Descriptor

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

func (Timestamp) Equal

func (m Timestamp) Equal(rhs Timestamp) bool

Equal returns a boolean value indicating whether the lhs timestamp equals to the rhs timestamp.

func (*Timestamp) GetLogicalTime

func (m *Timestamp) GetLogicalTime() uint32

func (*Timestamp) GetPhysicalTime

func (m *Timestamp) GetPhysicalTime() int64

func (Timestamp) Greater

func (m Timestamp) Greater(rhs Timestamp) bool

Greater returns a boolean value indicating whether the lhs timestamp is greater than the rhs timestamp value.

func (Timestamp) GreaterEq

func (m Timestamp) GreaterEq(rhs Timestamp) bool

GreaterEq returns a boolean value indicating whether the lhs timestamp is greater than or equal to the rhs timestamp value.

func (Timestamp) IsEmpty

func (m Timestamp) IsEmpty() bool

IsEmpty returns a boolean value indicating whether the current timestamp is an empty value.

func (Timestamp) Less

func (m Timestamp) Less(rhs Timestamp) bool

Less returns a boolean value indicating whether the lhs timestamp is less than the rhs timestamp value.

func (Timestamp) LessEq

func (m Timestamp) LessEq(rhs Timestamp) bool

LessEq returns a boolean value indicating whether the lhs timestamp is less than or equal to the rhs timestamp value.

func (*Timestamp) Marshal

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

func (*Timestamp) MarshalTo

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

func (*Timestamp) MarshalToSizedBuffer

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

func (Timestamp) Next

func (m Timestamp) Next() Timestamp

Next returns the smallest timestamp that is greater than the current timestamp.

func (Timestamp) Prev

func (m Timestamp) Prev() Timestamp

Prev returns the smallest timestamp that is less than the current 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) ToStdTime

func (m Timestamp) ToStdTime() time.Time

ToStdTime converts the HLC timestamp to a regular golang stdlib UTC timestamp. The logical time component of the HLC is lost after the conversion.

func (*Timestamp) Unmarshal

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

func (*Timestamp) XXX_DiscardUnknown

func (m *Timestamp) XXX_DiscardUnknown()

func (*Timestamp) XXX_Marshal

func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Timestamp) XXX_Merge

func (m *Timestamp) XXX_Merge(src proto.Message)

func (*Timestamp) XXX_Size

func (m *Timestamp) XXX_Size() int

func (*Timestamp) XXX_Unmarshal

func (m *Timestamp) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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