Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextWithCancel ¶ added in v1.11.5
func GetContextWithCancel() (context.Context, context.CancelFunc)
Types ¶
type PeriodicOnce ¶ added in v1.12.3
type PeriodicOnce struct {
// contains filtered or unexported fields
}
PeriodicOnce 周期性懒加载机制
func (*PeriodicOnce) Do ¶ added in v1.12.3
func (o *PeriodicOnce) Do(f func())
type RollingMutex ¶
type RollingMutex struct {
// contains filtered or unexported fields
}
RollingMutex 按指定rolling策略加锁, 指定周期内只加载一次
滑动窗口锁, 窗口期内只初始化一次, 目前只支持1天切换
func (*RollingMutex) Date ¶
func (o *RollingMutex) Date() string
func (*RollingMutex) Do ¶
func (o *RollingMutex) Do(f func(), today ...func() (newDate string))
func (*RollingMutex) Reset ¶
func (o *RollingMutex) Reset()
type RollingWaitGroup ¶ added in v1.14.2
type RollingWaitGroup struct {
// contains filtered or unexported fields
}
RollingWaitGroup 滑动窗口n的WaitGroup
func NewRollingWaitGroup ¶ added in v1.14.2
func NewRollingWaitGroup(n int) *RollingWaitGroup
NewRollingWaitGroup initialization RollingWaitGroup struct
func (*RollingWaitGroup) Add ¶ added in v1.14.2
func (g *RollingWaitGroup) Add(delta int)
func (*RollingWaitGroup) Done ¶ added in v1.14.2
func (g *RollingWaitGroup) Done()
func (*RollingWaitGroup) Wait ¶ added in v1.14.2
func (g *RollingWaitGroup) Wait()
Click to show internal directories.
Click to hide internal directories.