timestamppb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type Timestamp

type Timestamp struct {
	timestamppb.Timestamp
}

Timestamp is a wrapped timestamppb.Timestamp with proper JSON and XML marshaling (as string date).

func New

func New(t time.Time) *Timestamp

func (*Timestamp) AppendFormat

func (ts *Timestamp) AppendFormat(b []byte, layout string) []byte

func (*Timestamp) AsTime

func (ts *Timestamp) AsTime() time.Time

func (*Timestamp) AsTimestamp

func (ts *Timestamp) AsTimestamp() *timestamppb.Timestamp

func (*Timestamp) Format

func (ts *Timestamp) Format(layout string) string

func (*Timestamp) IsZero

func (ts *Timestamp) IsZero() (zero bool)

func (*Timestamp) MarshalJSON

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

func (*Timestamp) MarshalText

func (ts *Timestamp) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface. The time is formatted in RFC 3339 format, with sub-second precision added if present.

func (*Timestamp) MarshalToSizedBufferVT

func (m *Timestamp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Timestamp) MarshalToVT

func (m *Timestamp) MarshalToVT(dAtA []byte) (int, error)

func (*Timestamp) MarshalVT

func (m *Timestamp) MarshalVT() (dAtA []byte, err error)

func (*Timestamp) MarshalXML

func (ts *Timestamp) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

func (*Timestamp) Proto

func (ts *Timestamp) Proto()

func (*Timestamp) ProtoReflect

func (ts *Timestamp) ProtoReflect() protoreflect.Message

func (*Timestamp) Reset

func (ts *Timestamp) Reset()

func (*Timestamp) Scan

func (ts *Timestamp) Scan(src interface{}) error

func (*Timestamp) SizeVT

func (m *Timestamp) SizeVT() (n int)

func (*Timestamp) String

func (ts *Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (ts *Timestamp) UnmarshalJSON(data []byte) error

func (*Timestamp) UnmarshalText

func (ts *Timestamp) UnmarshalText(data []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface. The time is expected to be in RFC 3339 format.

func (*Timestamp) UnmarshalVT

func (m *Timestamp) UnmarshalVT(dAtA []byte) error

func (*Timestamp) UnmarshalXML

func (ts *Timestamp) UnmarshalXML(dec *xml.Decoder, st xml.StartElement) error

func (*Timestamp) Value

func (ts *Timestamp) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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