Documentation
¶
Index ¶
- type Cache
- type CacheWithTTL
- type Creater
- type MemoryCache
- func (mc *MemoryCache) Close() error
- func (mc *MemoryCache) Delete(key string)
- func (mc *MemoryCache) Exists(key string) bool
- func (mc *MemoryCache) Get(key string, out any) error
- func (mc *MemoryCache) GetOrCreate(key string, creater Creater, out any) error
- func (mc *MemoryCache) Set(key string, value any) error
- type MemoryCacheWithTTL
- func (mc *MemoryCacheWithTTL) Close() error
- func (mc *MemoryCacheWithTTL) Delete(key string)
- func (mc *MemoryCacheWithTTL) Exists(key string) bool
- func (mc *MemoryCacheWithTTL) Get(key string, out any) error
- func (mc *MemoryCacheWithTTL) GetOrCreate(key string, creator Creater, out any) error
- func (mc *MemoryCacheWithTTL) GetOrCreateWithTTL(key string, creator Creater, out any, ttl time.Duration) error
- func (mc *MemoryCacheWithTTL) Set(key string, value any) error
- func (mc *MemoryCacheWithTTL) SetWithTTL(key string, value any, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheWithTTL ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
func (*MemoryCache) Close ¶
func (mc *MemoryCache) Close() error
func (*MemoryCache) Delete ¶
func (mc *MemoryCache) Delete(key string)
func (*MemoryCache) Exists ¶
func (mc *MemoryCache) Exists(key string) bool
func (*MemoryCache) GetOrCreate ¶
func (mc *MemoryCache) GetOrCreate(key string, creater Creater, out any) error
type MemoryCacheWithTTL ¶
type MemoryCacheWithTTL struct {
// contains filtered or unexported fields
}
func NewMemoryCacheWithTTL ¶
func NewMemoryCacheWithTTL(compactInterval time.Duration) *MemoryCacheWithTTL
func (*MemoryCacheWithTTL) Close ¶
func (mc *MemoryCacheWithTTL) Close() error
func (*MemoryCacheWithTTL) Delete ¶
func (mc *MemoryCacheWithTTL) Delete(key string)
func (*MemoryCacheWithTTL) Exists ¶
func (mc *MemoryCacheWithTTL) Exists(key string) bool
func (*MemoryCacheWithTTL) GetOrCreate ¶
func (mc *MemoryCacheWithTTL) GetOrCreate(key string, creator Creater, out any) error
func (*MemoryCacheWithTTL) GetOrCreateWithTTL ¶
func (*MemoryCacheWithTTL) SetWithTTL ¶
Click to show internal directories.
Click to hide internal directories.