Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is a wrapper for timestamppb.Timestamp to provide custom marshaling for JSON and URL query strings.
It embeds timestamppb.Timestamp and exposes the .AsTime() method to easily convert to time.Time.
Example:
customTime := time.New(stdtime.Now()) goTime := customTime.AsTime()
func (Time) EncodeValues ¶
EncodeValues implements the [query.Encoder] interface by encoding the time as a protobuf Timestamp.
func (Time) MarshalJSON ¶
MarshalJSON implements the [json.Marshaler] interface by marshalling the time as a protobuf Timestamp.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the [json.Unmarshaler] interface by unmarshalling the time from a protobuf Timestamp.
Click to show internal directories.
Click to hide internal directories.