Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultLRUSize = 16 Byte MemStorage = 1 KiloByte = 1024 * Byte MegaByte = 1024 * KiloByte DefaultMinMemStorage MemStorage = 32 * MegaByte DefaultMaxMemStorage MemStorage = 128 * MegaByte )
Variables ¶
View Source
var ErrCastError = fmt.Errorf("cast to IPokeBall interface failed")
View Source
var ErrExceedStorage = fmt.Errorf("the new item cannot be fit into the member because of the size limitation")
View Source
var ErrNotInCache = fmt.Errorf("not in cache")
Functions ¶
This section is empty.
Types ¶
type Cacher ¶
type Cacher interface { Get(ctx context.Context, key string) (IPokeBall, error) Set(ctx context.Context, ball IPokeBall) error Contains(ctx context.Context, key string) bool }
func NewLRUCacher ¶
func NewRedisCacher ¶
func NewRedisCacher(cli *redis.Client) Cacher
type MemStorage ¶
type MemStorage int64
Click to show internal directories.
Click to hide internal directories.