Documentation
¶
Index ¶
- Variables
- type LegacyTimestamp
- func (*LegacyTimestamp) Descriptor() ([]byte, []int)
- func (this *LegacyTimestamp) Equal(that interface{}) bool
- func (t LegacyTimestamp) Less(s LegacyTimestamp) bool
- func (m *LegacyTimestamp) Marshal() (dAtA []byte, err error)
- func (m *LegacyTimestamp) MarshalTo(dAtA []byte) (int, error)
- func (*LegacyTimestamp) ProtoMessage()
- func (m *LegacyTimestamp) Reset()
- func (m *LegacyTimestamp) Size() (n int)
- func (t LegacyTimestamp) String() string
- func (m *LegacyTimestamp) Unmarshal(dAtA []byte) error
- func (m *LegacyTimestamp) XXX_DiscardUnknown()
- func (m *LegacyTimestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *LegacyTimestamp) XXX_Merge(src proto.Message)
- func (m *LegacyTimestamp) XXX_Size() int
- func (m *LegacyTimestamp) XXX_Unmarshal(b []byte) error
- type Timestamp
- func (t Timestamp) Add(wallTime int64, logical int32) Timestamp
- func (t Timestamp) AsOfSystemTime() string
- func (t *Timestamp) Backward(s Timestamp)
- func (t Timestamp) Clone() *Timestamp
- func (*Timestamp) Descriptor() ([]byte, []int)
- func (this *Timestamp) Equal(that interface{}) bool
- func (t Timestamp) FloorPrev() Timestamp
- func (t *Timestamp) Forward(s Timestamp) bool
- func (t Timestamp) GoTime() time.Time
- func (t Timestamp) IsEmpty() bool
- func (t Timestamp) Less(s Timestamp) bool
- func (t Timestamp) LessEq(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 (Timestamp) SafeValue()
- func (m *Timestamp) Size() (n int)
- func (t Timestamp) String() string
- func (m *Timestamp) Unmarshal(dAtA []byte) error
- func (m *Timestamp) XXX_DiscardUnknown()
- func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Timestamp) XXX_Merge(src proto.Message)
- func (m *Timestamp) XXX_Size() int
- func (m *Timestamp) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthLegacyTimestamp = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowLegacyTimestamp = fmt.Errorf("proto: integer overflow") )
var ( // MaxTimestamp is the max value allowed for Timestamp. MaxTimestamp = Timestamp{WallTime: math.MaxInt64, Logical: math.MaxInt32} // MinTimestamp is the min value allowed for Timestamp. MinTimestamp = Timestamp{WallTime: 0, Logical: 1} )
Timestamp constant values.
var ( ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow") )
Functions ¶
This section is empty.
Types ¶
type LegacyTimestamp ¶
type LegacyTimestamp struct { // Holds a wall time, typically a unix epoch time expressed in // nanoseconds. WallTime int64 `protobuf:"varint,1,opt,name=wall_time,json=wallTime" json:"wall_time"` // 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" json:"logical"` }
LegacyTimestamp is convertible to hlc.Timestamp, but uses the legacy encoding as it is encoded "below raft".
func NewPopulatedLegacyTimestamp ¶
func NewPopulatedLegacyTimestamp(r randyLegacyTimestamp, easy bool) *LegacyTimestamp
func (*LegacyTimestamp) Descriptor ¶
func (*LegacyTimestamp) Descriptor() ([]byte, []int)
func (*LegacyTimestamp) Equal ¶
func (this *LegacyTimestamp) Equal(that interface{}) bool
func (LegacyTimestamp) Less ¶
func (t LegacyTimestamp) Less(s LegacyTimestamp) bool
Less returns whether the receiver is less than the parameter.
func (*LegacyTimestamp) Marshal ¶
func (m *LegacyTimestamp) Marshal() (dAtA []byte, err error)
func (*LegacyTimestamp) ProtoMessage ¶
func (*LegacyTimestamp) ProtoMessage()
func (*LegacyTimestamp) Reset ¶
func (m *LegacyTimestamp) Reset()
func (*LegacyTimestamp) Size ¶
func (m *LegacyTimestamp) Size() (n int)
func (LegacyTimestamp) String ¶
func (t LegacyTimestamp) String() string
func (*LegacyTimestamp) Unmarshal ¶
func (m *LegacyTimestamp) Unmarshal(dAtA []byte) error
func (*LegacyTimestamp) XXX_DiscardUnknown ¶
func (m *LegacyTimestamp) XXX_DiscardUnknown()
func (*LegacyTimestamp) XXX_Marshal ¶
func (m *LegacyTimestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LegacyTimestamp) XXX_Merge ¶
func (dst *LegacyTimestamp) XXX_Merge(src proto.Message)
func (*LegacyTimestamp) XXX_Size ¶
func (m *LegacyTimestamp) XXX_Size() int
func (*LegacyTimestamp) XXX_Unmarshal ¶
func (m *LegacyTimestamp) XXX_Unmarshal(b []byte) error
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 NewPopulatedTimestamp ¶
func ParseTimestamp ¶
ParseTimestamp attempts to parse the string generated from Timestamp.String().
func (Timestamp) Add ¶
Add returns a timestamp with the WallTime and Logical components increased. wallTime is expressed in nanos.
func (Timestamp) AsOfSystemTime ¶
AsOfSystemTime returns a string to be used in an AS OF SYSTEM TIME query.
func (*Timestamp) Backward ¶
Backward updates the timestamp from the one given, if that moves it backwards in time.
func (*Timestamp) Descriptor ¶
func (Timestamp) FloorPrev ¶
FloorPrev returns a timestamp earlier than the current timestamp. If it can subtract a logical tick without wrapping around, it does so. Otherwise it subtracts a nanosecond from the walltime.
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) LessEq ¶
LessEq returns whether the receiver is less than or equal to the parameter.
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
func (Timestamp) SafeValue ¶
func (Timestamp) SafeValue()
SafeValue implements the redact.SafeValue interface.
func (*Timestamp) XXX_DiscardUnknown ¶
func (m *Timestamp) XXX_DiscardUnknown()