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 ¶
- Variables
- type Timestamp
- func (t Timestamp) Add(wallTime int64, logical int32) Timestamp
- func (t *Timestamp) Backward(s Timestamp)
- func (*Timestamp) Descriptor() ([]byte, []int)
- func (t Timestamp) Equal(s Timestamp) bool
- func (t *Timestamp) Forward(s Timestamp) bool
- func (m *Timestamp) GetLogical() int32
- func (m *Timestamp) GetWallTime() int64
- func (t Timestamp) GoTime() time.Time
- func (t Timestamp) Less(s Timestamp) bool
- func (t Timestamp) LessOrEqual(s Timestamp) bool
- func (m *Timestamp) Marshal() (dAtA []byte, err error)
- func (m *Timestamp) MarshalTo(dAtA []byte) (int, error)
- func (t Timestamp) Next() Timestamp
- func (t Timestamp) Prev() Timestamp
- func (*Timestamp) ProtoMessage()
- func (m *Timestamp) Reset()
- func (m *Timestamp) Size() (n int)
- func (m *Timestamp) String() string
- func (t Timestamp) TString() string
- func (m *Timestamp) Unmarshal(dAtA []byte) error
- func (t Timestamp) Valid() bool
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 ¶
Add returns a timestamp with the WallTime and Logical components increased. wallTime is expressed in nanos.
func (*Timestamp) Backward ¶
Backward updates the timestamp from the one given, if that moves it backwards in time.
func (*Timestamp) Descriptor ¶
func (*Timestamp) Forward ¶
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 (*Timestamp) GetWallTime ¶
func (Timestamp) LessOrEqual ¶
LessOrEqual compares two timestamps.
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.