Documentation ¶
Index ¶
- func Close(name string) error
- func Delete(name string, key string) error
- func Get(name string, key string) ([]byte, error)
- func GetCache(name string) (*bigcache.BigCache, bool)
- func InitBigCache(name string, opts ...ConfigOpt) *bigcache.BigCache
- func NewBigCache(ctx context.Context, name string, opts ...ConfigOpt) error
- func Set(name string, key string, value []byte) error
- type ConfigOpt
- func WithCleanWindow(cleanWindow time.Duration) ConfigOpt
- func WithHardMaxCacheSize(size int) ConfigOpt
- func WithHasher(hasher bigcache.Hasher) ConfigOpt
- func WithLifeWindow(lifeWindow time.Duration) ConfigOpt
- func WithLogger(l bigcache.Logger) ConfigOpt
- func WithMaxEntriesInWindow(max int) ConfigOpt
- func WithMaxEntrySize(max int) ConfigOpt
- func WithOnRemove(f func(string, []byte)) ConfigOpt
- func WithOnRemoveWithMetadata(f func(string, []byte, bigcache.Metadata)) ConfigOpt
- func WithOnRemoveWithReason(f func(string, []byte, bigcache.RemoveReason)) ConfigOpt
- func WithShards(shards int) ConfigOpt
- func WithStatsEnabled(enable bool) ConfigOpt
- func WithVerbose(v bool) ConfigOpt
- type Hasher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBigCache ¶
func NewBigCache ¶
NewBigCache return Cacher implementation
Types ¶
type ConfigOpt ¶
type ConfigOpt func(*bigcache.Config)
ConfigOpt set bigcache.Config fileds
func WithCleanWindow ¶
WithLifeWindow set bigcache.Config.CleanWindow field
func WithHardMaxCacheSize ¶
WithHardMaxCacheSize set bigcache.Config.HardMaxCacheSize field
func WithHasher ¶
func WithHasher(hasher bigcache.Hasher) ConfigOpt
WithHasher set bigcache.Config.Hasher field
func WithLifeWindow ¶
WithLifeWindow set bigcache.Config.LifeWindow field
func WithLogger ¶
func WithLogger(l bigcache.Logger) ConfigOpt
WithLogger set bigcache.Config.Logger field
func WithMaxEntriesInWindow ¶
WithMaxEntriesInWindow set bigcache.Config.MaxEntriesInWindow field
func WithMaxEntrySize ¶
WithMaxEntrySize set bigcache.Config.MaxEntrySize
func WithOnRemove ¶
WithOnRemove set bigcache.Config.OnRemove
func WithOnRemoveWithMetadata ¶
WithOnRemoveWithMetadata set bigcache.Config.OnRemoveWithMetadata field
func WithOnRemoveWithReason ¶
WithOnRemoveWithReason set bigcache.Config.OnRemoveWithReason field
func WithStatsEnabled ¶
WithStatsEnabled set bigcache.Config.StatsEnabled field