time

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_time_v1_time_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Time

type Time struct {

	// Represents seconds of UTC time since Unix epoch
	// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
	// 9999-12-31T23:59:59Z inclusive.
	Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
	// Non-negative fractions of a second at nanosecond resolution. Negative
	// second values with fractions must still have non-negative nanos values
	// that count forward in time. Must be from 0 to 999,999,999
	// inclusive.
	Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
	// contains filtered or unexported fields
}

Time

source: https://github.com/protocolbuffers/protobuf/blob/b81c127e94d953aa9be5c9f00a1ad323552bae0e/src/google/protobuf/timestamp.proto

func From

func From(t time.Time) *Time

func Now

func Now() *Time

func (*Time) AsTime

func (x *Time) AsTime() time.Time

func (*Time) Descriptor deprecated

func (*Time) Descriptor() ([]byte, []int)

Deprecated: Use Time.ProtoReflect.Descriptor instead.

func (*Time) GetNanos

func (x *Time) GetNanos() int32

func (*Time) GetSeconds

func (x *Time) GetSeconds() int64

func (*Time) MarshalBinary

func (x *Time) MarshalBinary() ([]byte, error)

func (*Time) MarshalJSON

func (x *Time) MarshalJSON() ([]byte, error)

func (*Time) MarshalText

func (x *Time) MarshalText() ([]byte, error)

func (*Time) Parse

func (x *Time) Parse(layout, value string) error

func (*Time) ProtoMessage

func (*Time) ProtoMessage()

func (*Time) ProtoReflect

func (x *Time) ProtoReflect() protoreflect.Message

func (*Time) Reset

func (x *Time) Reset()

func (*Time) Scan

func (x *Time) Scan(src any) error

func (*Time) Set

func (x *Time) Set(t time.Time) *Time

func (*Time) String

func (x *Time) String() string

func (*Time) UnmarshalBinary

func (x *Time) UnmarshalBinary(b []byte) error

func (*Time) UnmarshalJSON

func (x *Time) UnmarshalJSON(b []byte) error

func (*Time) UnmarshalText

func (x *Time) UnmarshalText(b []byte) error

Jump to

Keyboard shortcuts

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