Documentation
¶
Index ¶
- Variables
- func ToTime(t uint64) time.Time
- func ToUnixMs(t time.Time) uint64
- type Timestamp
- func (t *Timestamp) Clone() *Timestamp
- func (m *Timestamp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Timestamp) CloneVT() *Timestamp
- func (this *Timestamp) EqualMessageVT(thatMsg any) bool
- func (this *Timestamp) EqualVT(that *Timestamp) bool
- func (t *Timestamp) Equals(ot *Timestamp) bool
- func (t *Timestamp) Format(formatStr string) string
- func (t *Timestamp) GetEmpty() bool
- func (x *Timestamp) GetTimeUnixMs() uint64
- func (t *Timestamp) MarshalJSON() ([]byte, error)
- func (t *Timestamp) MarshalProtoJSON(s *json.MarshalState)
- func (x *Timestamp) MarshalProtoText() string
- func (m *Timestamp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Timestamp) MarshalToVT(dAtA []byte) (int, error)
- func (m *Timestamp) MarshalVT() (dAtA []byte, err error)
- func (*Timestamp) ProtoMessage()
- func (x *Timestamp) Reset()
- func (m *Timestamp) SizeVT() (n int)
- func (x *Timestamp) String() string
- func (t *Timestamp) ToRFC3339() string
- func (t *Timestamp) ToTime() time.Time
- func (t *Timestamp) UnmarshalJSON(b []byte) error
- func (t *Timestamp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Timestamp) UnmarshalVT(dAtA []byte) error
- func (t *Timestamp) Validate(allowEmpty bool) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyTimestamp = errors.New("timestamp is empty")
ErrEmptyTimestamp is returned if the timestamp was empty.
Functions ¶
Types ¶
type Timestamp ¶
type Timestamp struct {
// TimeUnixMs timestamp in unix milliseconds.
TimeUnixMs uint64 `protobuf:"varint,1,opt,name=time_unix_ms,json=timeUnixMs,proto3" json:"timeUnixMs,omitempty"`
// contains filtered or unexported fields
}
Timestamp contains a cross-platform timestamp. protobuf-go-lite:disable-json
func ToTimestamp ¶
ToTimestamp generates a millisecond timestamp from the time object.
func (*Timestamp) CloneMessageVT ¶ added in v0.7.0
func (m *Timestamp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Timestamp) EqualMessageVT ¶ added in v0.7.0
func (*Timestamp) GetTimeUnixMs ¶
func (*Timestamp) MarshalJSON ¶ added in v0.7.0
MarshalJSON marshals the Timestamp to JSON.
func (*Timestamp) MarshalProtoJSON ¶ added in v0.9.0
func (t *Timestamp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Timestamp message to JSON.
func (*Timestamp) MarshalProtoText ¶ added in v0.8.3
func (*Timestamp) MarshalToSizedBufferVT ¶ added in v0.5.1
func (*Timestamp) MarshalToVT ¶ added in v0.5.1
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
func (*Timestamp) UnmarshalJSON ¶ added in v0.7.0
UnmarshalJSON unmarshals the Timestamp from JSON.
func (*Timestamp) UnmarshalProtoJSON ¶ added in v0.9.0
func (t *Timestamp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Timestamp message from JSON.
Supports string (unix milliseconds large value or RFC3339 timestamp), number (unix milliseconds)
func (*Timestamp) UnmarshalVT ¶ added in v0.5.1
Click to show internal directories.
Click to hide internal directories.