Documentation
¶
Index ¶
- Variables
- func Close() error
- func Delete(key string) error
- func Get(key string) (string, error)
- func GetBytes(key string) ([]byte, error)
- func GetBytesFunc(key string, fun func() []byte) ([]byte, error)
- func GetFunc(key string, fun func() []byte) (string, error)
- func GetJson(key string, dest any) (any, error)
- func GetJsonFunc(key string, dest any, fun func() []byte) (any, error)
- func InitDefault(config bigcache.Config, ctx context.Context)
- func InitDefault2(ctx context.Context)
- func InitDefault2WithBlot(boltDB *mbolt.Bolt, bucket string, ctx context.Context)
- func InitDefaultWithBlot(boltDB *mbolt.Bolt, bucket string, config bigcache.Config, ctx context.Context)
- func IsError(err error) bool
- func Set(key string, value string) error
- func SetBytes(key string, value []byte) error
- func SetJson(key string, dest any) error
- type BoltCacheable
- func (ce *BoltCacheable) Close() error
- func (ce *BoltCacheable) Delete(key string) error
- func (ce *BoltCacheable) Get(key string) (string, error)
- func (ce *BoltCacheable) GetBytes(key string) ([]byte, error)
- func (ce *BoltCacheable) GetBytesFunc(key string, fun func() []byte) ([]byte, error)
- func (ce *BoltCacheable) GetFunc(key string, fun func() []byte) (string, error)
- func (ce *BoltCacheable) GetJson(key string, dest any) (any, error)
- func (ce *BoltCacheable) GetJsonFunc(key string, dest any, fun func() []byte) (any, error)
- func (ce *BoltCacheable) Set(key string, value string) error
- func (ce *BoltCacheable) SetBytes(key string, value []byte) error
- func (ce *BoltCacheable) SetJson(key string, dest any) error
- type Cacheable
- func InitCache(config bigcache.Config, ctx context.Context) Cacheable
- func InitCache2(ctx context.Context) Cacheable
- func InitCache2WithBlot(boltDB *mbolt.Bolt, bucket string, ctx context.Context) Cacheable
- func InitCacheWithBlot(boltDB *mbolt.Bolt, bucket string, config bigcache.Config, ctx context.Context) Cacheable
- type MemoryCacheable
- func (ce *MemoryCacheable) Close() error
- func (ce *MemoryCacheable) Delete(key string) error
- func (ce *MemoryCacheable) Get(key string) (string, error)
- func (ce *MemoryCacheable) GetBytes(key string) ([]byte, error)
- func (ce *MemoryCacheable) GetBytesFunc(key string, fun func() []byte) ([]byte, error)
- func (ce *MemoryCacheable) GetFunc(key string, fun func() []byte) (string, error)
- func (ce *MemoryCacheable) GetJson(key string, dest any) (any, error)
- func (ce *MemoryCacheable) GetJsonFunc(key string, dest any, fun func() []byte) (any, error)
- func (ce *MemoryCacheable) Set(key string, value string) error
- func (ce *MemoryCacheable) SetBytes(key string, value []byte) error
- func (ce *MemoryCacheable) SetJson(key string, dest any) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InitDefault2 ¶
func InitDefault2WithBlot ¶
func InitDefaultWithBlot ¶
Types ¶
type BoltCacheable ¶
func (*BoltCacheable) Close ¶
func (ce *BoltCacheable) Close() error
func (*BoltCacheable) Delete ¶
func (ce *BoltCacheable) Delete(key string) error
func (*BoltCacheable) GetBytesFunc ¶
func (ce *BoltCacheable) GetBytesFunc(key string, fun func() []byte) ([]byte, error)
func (*BoltCacheable) GetFunc ¶
func (ce *BoltCacheable) GetFunc(key string, fun func() []byte) (string, error)
func (*BoltCacheable) GetJsonFunc ¶
type Cacheable ¶
type Cacheable interface {
Get(key string) (string, error)
GetFunc(key string, fun func() []byte) (string, error)
GetBytes(key string) ([]byte, error)
GetBytesFunc(key string, fun func() []byte) ([]byte, error)
Set(key string, value string) error
SetBytes(key string, value []byte) error
Delete(key string) error
GetJsonFunc(key string, dest any, fun func() []byte) (any, error)
GetJson(key string, dest any) (any, error)
SetJson(key string, dest any) error
Close() error
}
var Default Cacheable
func InitCache2 ¶
func InitCache2WithBlot ¶
type MemoryCacheable ¶
func (*MemoryCacheable) Close ¶
func (ce *MemoryCacheable) Close() error
func (*MemoryCacheable) Delete ¶
func (ce *MemoryCacheable) Delete(key string) error
func (*MemoryCacheable) GetBytesFunc ¶
func (ce *MemoryCacheable) GetBytesFunc(key string, fun func() []byte) ([]byte, error)
func (*MemoryCacheable) GetFunc ¶
func (ce *MemoryCacheable) GetFunc(key string, fun func() []byte) (string, error)
func (*MemoryCacheable) GetJson ¶
func (ce *MemoryCacheable) GetJson(key string, dest any) (any, error)
func (*MemoryCacheable) GetJsonFunc ¶
Click to show internal directories.
Click to hide internal directories.