cache

package
v0.0.0-...-8bf0c8e Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BizConfPrefix  = "biz_conf"
	DefaultExpires = 15 * time.Minute
)

Variables

View Source
var (
	ErrBizConfCacheKeyNotFound = fmt.Errorf("[jotify] biz conf cache key not found")
	ErrWrongTypeOfBizConfCache = fmt.Errorf("[jotify] wrong type of biz conf cache")
)

Functions

func BizConfCacheKey

func BizConfCacheKey(bizId uint64) string

Types

type BizConfCache

type BizConfCache interface {
	Set(ctx context.Context, id uint64, conf domain.BizConf) error
	Get(ctx context.Context, id uint64) (domain.BizConf, error)
}

type QuotaCache

type QuotaCache interface {
	Incr(ctx context.Context, param QuotaParam) error
	BatchIncr(ctx context.Context, params []QuotaParam) error
	Decr(ctx context.Context, param QuotaParam) error
	BatchDecr(ctx context.Context, params []QuotaParam) error
}

type QuotaParam

type QuotaParam struct {
	BizId   uint64
	Quota   int32
	Channel domain.Channel
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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