timestamp

package
v0.0.0-...-d581519 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayoutTimestamp = "2006-01-02T15:04:05.999999999Z-0700MST"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp wraps time.

func DecodeTimestamp

func DecodeTimestamp(pbuf *pb.Timestamp) (ts Timestamp, err error)

DecodeTimestamp decodes a protobuf encoded message.

func Now

func Now() Timestamp

Now returns Timestamp initialized with current UTC time.

func (*Timestamp) Decode

func (t *Timestamp) Decode(pbuf *pb.Timestamp) error

Decode converts protobuf message into object.

func (*Timestamp) Encode

func (t *Timestamp) Encode() (*pb.Timestamp, error)

Encode converts object into protobuf message.

func (*Timestamp) Marshal

func (t *Timestamp) Marshal() ([]byte, error)

Marshal implements marshaler interface for types that can marshal themselves into bytes.

func (*Timestamp) MarshalJSON

func (t *Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON implements marshaler interface for types that can marshal themselves into valid JSON.

func (*Timestamp) Parse

func (t *Timestamp) Parse(value string) error

Parse sets Timestamp form LayoutTimestamp string.

func (*Timestamp) Pretty

func (t *Timestamp) Pretty() string

Pretty returns human-readable string.

func (*Timestamp) String

func (t *Timestamp) String() string

String implements stringer interface.

func (*Timestamp) UnixNanoStr

func (t *Timestamp) UnixNanoStr() string

UnixNanoStr returns string representation as string of UnixNano.

func (*Timestamp) Unmarshal

func (t *Timestamp) Unmarshal(b []byte) error

Unmarshal implements unmarshaler interface for types that can unmarshal bytes of themselves.

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON implements unmarshaler interface for types that can unmarshal a JSON description of themselves.

Directories

Path Synopsis
proto
pb

Jump to

Keyboard shortcuts

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