timestamp

package
v0.0.0-...-a26ebea Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type Timestamp struct {
	time.Time
}

Timestamp represents a kafka message timestamp.

func Generate

func Generate(rand *rand.Rand) Timestamp

Generate a random Timestamp value.

func New

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

func (t Timestamp) Equals(v any) bool

Equals compares two Timestamp instances for equality.

Interface: comparison.Equaler

func (Timestamp) Generate

func (Timestamp) Generate(rand *rand.Rand, size int) reflect.Value

Generate random Timestamp values.

Interface: quick.Generator

func (Timestamp) MarshalBinary

func (t Timestamp) MarshalBinary() (data []byte, err error)

MarshalBinary converts the Timestamp instance to binary form.

Interface: encoding.BinaryMarshaler

func (Timestamp) MarshalBinaryWriter

func (t Timestamp) MarshalBinaryWriter(w io.Writer) (err error)

MarshalBinaryWriter populates the io.Writer with Timestamp data in its binary form.

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() (data []byte, err error)

MarshalJSON converts the Timestamp instance to JSON form.

Interface: json.Marshaler

func (Timestamp) String

func (t Timestamp) String() string

String value of the Timestamp.

Interface: fmt.Stringer.

func (*Timestamp) UnmarshalBinary

func (t *Timestamp) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts the binary form to a Timestamp instance.

Interface: encoding.BinaryUnmarshaler

func (*Timestamp) UnmarshalBinaryReader

func (t *Timestamp) UnmarshalBinaryReader(r io.Reader) (err error)

UnmarshalBinaryReader populates Timestamp from an io.Reader returning the binary form.

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON converts the JSON form to a Timestamp instance.

Interface: json.Unmarshal

Jump to

Keyboard shortcuts

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