Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Now ¶
func Now() int64
Now calculates the current minute bucket based on the current UTC time. It returns the Unix timestamp divided by the number of seconds in a minute.
func ToMinuteBucket ¶
ToMinuteBucket converts a given time.Time object to its corresponding minute bucket. It calculates the bucket by dividing the time's UTC Unix timestamp by the number of seconds in a minute.
Args:
t (time.Time): The time to convert.
Returns:
(int64): The minute bucket representation of the time.
func ToUnix ¶
ToUnix converts a minute bucket value back to a Unix timestamp (in seconds). It represents the start time of that minute bucket.
Args:
minuteBucket (int64): The minute bucket value.
Returns:
(int64): The corresponding Unix timestamp in seconds.
func ToUnixMicro ¶
ToUnixMicro converts a minute bucket value back to a Unix timestamp in microseconds. It represents the start time of that minute bucket.
Args:
minuteBucket (int64): The minute bucket value.
Returns:
(int64): The corresponding Unix timestamp in microseconds.
func ToUnixMilli ¶
ToUnixMilli converts a minute bucket value back to a Unix timestamp in milliseconds. It represents the start time of that minute bucket.
Args:
minuteBucket (int64): The minute bucket value.
Returns:
(int64): The corresponding Unix timestamp in milliseconds.
func ToUnixNano ¶
ToUnixNano converts a minute bucket value back to a Unix timestamp in nanoseconds. It represents the start time of that minute bucket.
Args:
minuteBucket (int64): The minute bucket value.
Returns:
(int64): The corresponding Unix timestamp in nanoseconds.
Types ¶
This section is empty.