time

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_hopeio_time_time_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Date

type Date struct {
	Days int32 `protobuf:"varint,1,opt,name=days,proto3" json:"days,omitempty"`
	// contains filtered or unexported fields
}

func (*Date) Descriptor deprecated

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

Deprecated: Use Date.ProtoReflect.Descriptor instead.

func (*Date) GetDays added in v0.1.4

func (x *Date) GetDays() int32

func (*Date) GobDecode

func (x *Date) GobDecode(data []byte) error

func (*Date) GobEncode

func (x *Date) GobEncode() ([]byte, error)

func (*Date) GormDataType

func (x *Date) GormDataType() string

func (*Date) MarshalBinary

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

func (*Date) MarshalGQL

func (x *Date) MarshalGQL(w io.Writer)

func (*Date) MarshalJSON

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

func (*Date) MarshalText added in v0.1.4

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

func (*Date) ProtoMessage

func (*Date) ProtoMessage()

func (*Date) ProtoReflect

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

func (*Date) Reset

func (x *Date) Reset()

func (*Date) Scan

func (x *Date) Scan(value interface{}) error

func (*Date) String

func (x *Date) String() string

func (*Date) Time

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

func (*Date) UnmarshalBinary

func (x *Date) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Date) UnmarshalGQL

func (x *Date) UnmarshalGQL(v interface{}) error

func (*Date) UnmarshalJSON

func (x *Date) UnmarshalJSON(data []byte) error

func (*Date) UnmarshalText added in v0.1.4

func (x *Date) UnmarshalText(data []byte) error

func (*Date) Value

func (x *Date) Value() (driver.Value, error)

type DateInput

type DateInput = Date

type Duration

type Duration struct {
	Duration int64 `protobuf:"varint,1,opt,name=duration,proto3" json:"duration,omitempty"`
	// contains filtered or unexported fields
}

func (*Duration) Descriptor deprecated

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

Deprecated: Use Duration.ProtoReflect.Descriptor instead.

func (*Duration) GetDuration

func (x *Duration) GetDuration() int64

func (*Duration) ProtoMessage

func (*Duration) ProtoMessage()

func (*Duration) ProtoReflect

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

func (*Duration) Reset

func (x *Duration) Reset()

func (*Duration) String

func (x *Duration) String() string

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
}

func NewTime

func NewTime(t time.Time) *Time

New constructs a new Timestamp from the provided time.Time.

func Now

func Now() *Time

func (*Time) AsTime

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

AsTime converts x to a time.Time.

func (*Time) CheckValid

func (x *Time) CheckValid() error

CheckValid returns an error if the timestamp is invalid. In particular, it checks whether the value represents a date that is in the range of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. An error is reported for a nil Timestamp.

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) GobDecode

func (x *Time) GobDecode(data []byte) error

func (*Time) GobEncode

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

func (*Time) GormDataType

func (x *Time) GormDataType() string

func (*Time) IsValid

func (x *Time) IsValid() bool

IsValid reports whether the timestamp is valid. It is equivalent to CheckValid == nil.

func (*Time) MarshalBinary

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

func (*Time) MarshalGQL

func (x *Time) MarshalGQL(w io.Writer)

func (*Time) MarshalJSON

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

func (*Time) MarshalText added in v0.5.11

func (x *Time) MarshalText(w io.Writer)

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(value interface{}) (err error)

func (*Time) String

func (x *Time) String() string

func (*Time) Time

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

func (*Time) UnmarshalBinary

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

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Time) UnmarshalGQL

func (x *Time) UnmarshalGQL(v interface{}) error

func (*Time) UnmarshalJSON

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

func (*Time) UnmarshalText added in v0.5.11

func (x *Time) UnmarshalText(v interface{}) error

func (*Time) Value

func (x *Time) Value() (driver.Value, error)

type TimeInput

type TimeInput = Time

type Timestamp

type Timestamp struct {
	Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*Timestamp) Descriptor deprecated

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

Deprecated: Use Timestamp.ProtoReflect.Descriptor instead.

func (*Timestamp) GetTimestamp added in v0.5.11

func (x *Timestamp) GetTimestamp() int64

func (*Timestamp) GobDecode

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

func (*Timestamp) GobEncode

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

func (*Timestamp) GormDataType

func (ts *Timestamp) GormDataType() string

func (*Timestamp) MarshalBinary

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

func (*Timestamp) MarshalJSON

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

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) ProtoReflect

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

func (*Timestamp) Reset

func (x *Timestamp) Reset()

func (*Timestamp) Scan

func (ts *Timestamp) Scan(value interface{}) (err error)

func (*Timestamp) String

func (x *Timestamp) String() string

func (*Timestamp) Time

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

func (*Timestamp) UnmarshalBinary

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

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Timestamp) UnmarshalJSON

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

func (*Timestamp) Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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