Documentation ¶
Index ¶
- Variables
- type Timestamp
- func (t Timestamp) Check() validation.ErrorGroup
- func (t Timestamp) Equals(v any) bool
- func (Timestamp) Generate(rand *rand.Rand, size int) reflect.Value
- func (t Timestamp) MarshalBinary() (data []byte, err error)
- func (t Timestamp) MarshalBinaryWriter(w io.Writer) (err error)
- func (t Timestamp) MarshalJSON() (data []byte, err error)
- func (t Timestamp) String() string
- func (t *Timestamp) UnmarshalBinary(data []byte) (err error)
- func (t *Timestamp) UnmarshalBinaryReader(r io.Reader) (err error)
- func (t *Timestamp) UnmarshalJSON(data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrMustBeNewerThanUnixEpoch = validation.NewError( "timestamp_must_be_newer_than_unix_epoch", fmt.Sprintf("the timestamp value must be newer than %s", unixEpoch), )
ErrMustBeNewerThanUnixEpoch is the validation check error returned when the timestamp is before the unix epoch (Jan 1st, 1970).
Functions ¶
This section is empty.
Types ¶
type Timestamp ¶
Timestamp represents a kafka message timestamp.
func New ¶
func New(t time.Time) (Timestamp, validation.ErrorGroup)
New creates and validates a new Timestamp from the given time.Time.
func (Timestamp) Check ¶
func (t Timestamp) Check() validation.ErrorGroup
Check runs default validation checks for the Timestamp.
func (Timestamp) Equals ¶
Equals compares two Timestamp instances for equality.
Interface: comparison.Equaler
func (Timestamp) MarshalBinary ¶
MarshalBinary converts the Timestamp instance to binary form.
Interface: encoding.BinaryMarshaler
func (Timestamp) MarshalBinaryWriter ¶
MarshalBinaryWriter populates the io.Writer with Timestamp data in its binary form.
func (Timestamp) MarshalJSON ¶
MarshalJSON converts the Timestamp instance to JSON form.
Interface: json.Marshaler
func (*Timestamp) UnmarshalBinary ¶
UnmarshalBinary converts the binary form to a Timestamp instance.
Interface: encoding.BinaryUnmarshaler
func (*Timestamp) UnmarshalBinaryReader ¶
UnmarshalBinaryReader populates Timestamp from an io.Reader returning the binary form.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON converts the JSON form to a Timestamp instance.
Interface: json.Unmarshal