Documentation
¶
Index ¶
- func Delete(key string)
- func Exists(key string) bool
- func Get(key string, v any) bool
- func GetBool(key string) (bool, bool)
- func GetOrAdd[T interface{}](key string, v *T, creator func(k string) (T, error)) error
- func Set(key string, value any)
- func SetBool(key string, v bool)
- type Cache
- type CacheOptions
- type MemoryCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
GetOrAdd(key string, creator func(k string) ([]byte, error)) []byte
Get(key string) ([]byte, bool)
Set(key string, value []byte)
Delete(key string)
Exits(key string) bool
}
func NewMemoryCache ¶
func NewMemoryCache(options *CacheOptions) Cache
type CacheOptions ¶
type CacheOptions struct {
// contains filtered or unexported fields
}
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func (*MemoryCache) Delete ¶
func (c *MemoryCache) Delete(key string)
func (*MemoryCache) Exits ¶
func (c *MemoryCache) Exits(key string) bool
func (*MemoryCache) Set ¶
func (c *MemoryCache) Set(key string, value []byte)
Click to show internal directories.
Click to hide internal directories.