xtime

package
v0.0.0-...-d80f745 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Hour = time.Hour
	Day  = 24 * Hour
	Week = 7 * Day
)

Functions

func DayJitter

func DayJitter(t time.Duration) time.Duration

func DayJitterSec

func DayJitterSec(t time.Duration) int

func HourJitter

func HourJitter(t time.Duration) time.Duration

func HourJitterSec

func HourJitterSec(t time.Duration) int

func Jitter

func Jitter(d time.Duration) int64

返回随机过期时间

func JitterDuration

func JitterDuration(d time.Duration) time.Duration

func WeekJitter

func WeekJitter(t time.Duration) time.Duration

func WeekJitterSec

func WeekJitterSec(t time.Duration) int

Types

type Duration

type Duration time.Duration

可以解析1m 2h等的时间格式

func (*Duration) UnmarshalYAML

func (t *Duration) UnmarshalYAML(value *yaml.Node) error

实现yaml.Unmarshaler接口

Jump to

Keyboard shortcuts

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