Documentation
¶
Overview ¶
重试策略
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrHookProgress ¶
错误 curTryIndex 重试进度 totalTry 重试总数 err 错误信息
type FixIntervalRetry ¶
func (*FixIntervalRetry) Clear ¶
func (f *FixIntervalRetry) Clear()
func (*FixIntervalRetry) IsOver ¶
func (f *FixIntervalRetry) IsOver() bool
type FixIntervalRetryManager ¶
type FixIntervalRetryManager struct {
// contains filtered or unexported fields
}
func GetInstallFixIntervalRetryManager ¶
func GetInstallFixIntervalRetryManager() *FixIntervalRetryManager
func (*FixIntervalRetryManager) Get ¶
func (f *FixIntervalRetryManager) Get(Interval time.Duration, Max int) (*FixIntervalRetry, error)
func (*FixIntervalRetryManager) Put ¶
func (f *FixIntervalRetryManager) Put(item *FixIntervalRetry)
type ICache ¶
type ICache interface {
Get(ctx context.Context, key string) (any, error)
Set(ctx context.Context, key string, value any, expiration time.Duration) error
Delete(ctx context.Context, key string) error
//删除所有的缓存
Clear(ctx context.Context, errHonk ErrHookProgress)
//销毁
Destroy(ctx context.Context)
}
本地缓存接口
type IRedisCache ¶
type IRedisCache interface {
ICache
GetRedis() (*redis.Cmdable, uint8)
//#region hash
HSet(ctx context.Context, hashName string, key string, value any) error
HGet(ctx context.Context, hashName string, key string) (any, error)
HLength(ctx context.Context, hashName string) (int64, error)
HDelete(ctx context.Context, hashName string, key string) error
HExpire(ctx context.Context, hashName string, expiration time.Duration) error
HKeys(ctx context.Context, hashName string) ([]string, error)
HGetAll(ctx context.Context, hashName string) (map[string]string, error)
//#region list
ListPush(ctx context.Context, listName string, value ...any) error
ListPop(ctx context.Context, listName string) (string, error)
ListUnshift(ctx context.Context, listName string, value ...any) error
ListShift(ctx context.Context, listName string) (string, error)
LLength(ctx context.Context, listName string) (int64, error)
}
Redis缓存接口
type IRetryStrategy ¶
Click to show internal directories.
Click to hide internal directories.