Documentation ¶
Index ¶
- Constants
- Variables
- func IsCancel(ctx context.Context) bool
- func NewContext(timeout time.Duration) context.Context
- func NewContextWithReuqest() context.Context
- func StartCrondWithTimestamp(label string, callback CrondCallback)
- func TomorrowWaitDuration(currentTimestamp, waitSeconds int64) time.Duration
- type CrondCallback
Constants ¶
View Source
const ( CrondWait = time.Second * 2 CrondMust = time.Millisecond * 500 )
推荐执行时间
View Source
const (
TimeDev = time.Minute * 10
)
推荐时间
Variables ¶
View Source
var ErrCtxTimeout = errors.New("上下文通知请求结束")
上下文错误 @author fuzeyu
Functions ¶
func NewContext ¶
创建一个指定超时时间的上下文 @param timeout 超时时间
func StartCrondWithTimestamp ¶
func StartCrondWithTimestamp(label string, callback CrondCallback)
开始执行一个定时器方法 @param callback 回调方法
func TomorrowWaitDuration ¶
获取明天指定秒数的一个时间戳 @param currentTimestamp 当前时间戳 @param waitSeconds 等待时间
Types ¶
Click to show internal directories.
Click to hide internal directories.