Documentation ¶
Index ¶
- func DuplicateDuration(x *durationpb.Duration) *durationpb.Duration
- func DuplicateTimestamp(x *timestamppb.Timestamp) *timestamppb.Timestamp
- func DurationAsMicroseconds(x *durationpb.Duration) int64
- func DurationAsMilliseconds(x *durationpb.Duration) int64
- func DurationAsNanos(x *durationpb.Duration) *big.Int
- func DurationAsNanoseconds(x *durationpb.Duration) int64
- func DurationAsSeconds(x *durationpb.Duration) int64
- func IsTimestampZero(x *timestamppb.Timestamp) bool
- func NewDuration(d time.Duration) *durationpb.Duration
- func NewDurationByMicroseconds(d int64) *durationpb.Duration
- func NewDurationByMilliseconds(d int64) *durationpb.Duration
- func NewDurationByNanoseconds(d int64) *durationpb.Duration
- func NewDurationBySeconds(d int64) *durationpb.Duration
- func NewTimestamp(t time.Time) *timestamppb.Timestamp
- func NewTimestampByMicroseconds(d int64) *timestamppb.Timestamp
- func NewTimestampByMilliseconds(d int64) *timestamppb.Timestamp
- func NewTimestampByNanoseconds(d int64) *timestamppb.Timestamp
- func NewTimestampBySeconds(d int64) *timestamppb.Timestamp
- func TimestampAsMicroseconds(x *timestamppb.Timestamp) int64
- func TimestampAsMilliseconds(x *timestamppb.Timestamp) int64
- func TimestampAsNanos(x *timestamppb.Timestamp) *big.Int
- func TimestampAsNanoseconds(x *timestamppb.Timestamp) int64
- func TimestampAsSeconds(x *timestamppb.Timestamp) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DuplicateDuration ¶
func DuplicateDuration(x *durationpb.Duration) *durationpb.Duration
DuplicateDuration duplicates the Duration without any check.
func DuplicateTimestamp ¶
func DuplicateTimestamp(x *timestamppb.Timestamp) *timestamppb.Timestamp
DuplicateTimestamp duplicates the Timestamp without any check.
func DurationAsMicroseconds ¶
func DurationAsMicroseconds(x *durationpb.Duration) int64
DurationAsMicroseconds returns microseconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
func DurationAsMilliseconds ¶
func DurationAsMilliseconds(x *durationpb.Duration) int64
DurationAsMilliseconds returns milliseconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
func DurationAsNanos ¶
func DurationAsNanos(x *durationpb.Duration) *big.Int
DurationAsNanos returns nanoseconds as big.Int.
func DurationAsNanoseconds ¶
func DurationAsNanoseconds(x *durationpb.Duration) int64
DurationAsNanoseconds returns nanoseconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
func DurationAsSeconds ¶
func DurationAsSeconds(x *durationpb.Duration) int64
DurationAsSeconds returns seconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
func IsTimestampZero ¶
func IsTimestampZero(x *timestamppb.Timestamp) bool
IsTimestampZero checks whether the Timestamp is zero. If the Timestamp is nil or zero as time.Time, it returns true. Otherwise, returns false.
func NewDuration ¶
func NewDuration(d time.Duration) *durationpb.Duration
NewDuration constructs a new Duration from the provided duration d.
func NewDurationByMicroseconds ¶
func NewDurationByMicroseconds(d int64) *durationpb.Duration
NewDurationByMicroseconds constructs a new Duration from the provided int64 by microseconds.
func NewDurationByMilliseconds ¶
func NewDurationByMilliseconds(d int64) *durationpb.Duration
NewDurationByMilliseconds constructs a new Duration from the provided int64 by milliseconds.
func NewDurationByNanoseconds ¶
func NewDurationByNanoseconds(d int64) *durationpb.Duration
NewDurationByNanoseconds constructs a new Duration from the provided int64 by nanoseconds.
func NewDurationBySeconds ¶
func NewDurationBySeconds(d int64) *durationpb.Duration
NewDurationBySeconds constructs a new Duration from the provided int64 by seconds.
func NewTimestamp ¶
func NewTimestamp(t time.Time) *timestamppb.Timestamp
NewTimestamp constructs a new Timestamp from the provided time t. If t is zero, it returns nil.
func NewTimestampByMicroseconds ¶
func NewTimestampByMicroseconds(d int64) *timestamppb.Timestamp
NewTimestampByMicroseconds constructs a new Timestamp from the provided int64 unix timestamp by microseconds.
func NewTimestampByMilliseconds ¶
func NewTimestampByMilliseconds(d int64) *timestamppb.Timestamp
NewTimestampByMilliseconds constructs a new Timestamp from the provided int64 unix timestamp by milliseconds.
func NewTimestampByNanoseconds ¶
func NewTimestampByNanoseconds(d int64) *timestamppb.Timestamp
NewTimestampByNanoseconds constructs a new Timestamp from the provided int64 unix timestamp by nanoseconds.
func NewTimestampBySeconds ¶
func NewTimestampBySeconds(d int64) *timestamppb.Timestamp
NewTimestampBySeconds constructs a new Timestamp from the provided int64 unix timestamp by seconds.
func TimestampAsMicroseconds ¶
func TimestampAsMicroseconds(x *timestamppb.Timestamp) int64
TimestampAsMicroseconds returns unix timestamp by microseconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
func TimestampAsMilliseconds ¶
func TimestampAsMilliseconds(x *timestamppb.Timestamp) int64
TimestampAsMilliseconds returns unix timestamp by milliseconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
func TimestampAsNanos ¶
func TimestampAsNanos(x *timestamppb.Timestamp) *big.Int
TimestampAsNanos returns unix timestamp by nanoseconds as big.Int.
func TimestampAsNanoseconds ¶
func TimestampAsNanoseconds(x *timestamppb.Timestamp) int64
TimestampAsNanoseconds returns unix timestamp by nanoseconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
func TimestampAsSeconds ¶
func TimestampAsSeconds(x *timestamppb.Timestamp) int64
TimestampAsSeconds returns unix timestamp by seconds as int64. If the result is out of range, it returns math.MaxInt64 or math.MinInt64.
Types ¶
This section is empty.