Documentation
¶
Index ¶
- type Cache
- type CompressedCache
- func (ch *CompressedCache[K, V]) Close()
- func (ch *CompressedCache[K, V]) Del(k K)
- func (ch *CompressedCache[K, V]) Get(k K) (V, bool)
- func (ch *CompressedCache[K, V]) GetTTL(k K) (time.Duration, bool)
- func (ch *CompressedCache[K, V]) Set(k K, v V) bool
- func (ch *CompressedCache[K, V]) SetWithTTL(k K, v V, ttl time.Duration) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V any] interface { // Get get cache data by key Get(k K) (V, bool) // Set set new cache data Set(k K, v V) bool // Remove remove the specified key Del(k K) SetWithTTL(k K, v V, ttl time.Duration) bool GetTTL(k K) (time.Duration, bool) Close() }
func NewCompressedCache ¶
type CompressedCache ¶
type CompressedCache[K comparable, V any] struct { // contains filtered or unexported fields }
func (*CompressedCache[K, V]) Close ¶
func (ch *CompressedCache[K, V]) Close()
func (*CompressedCache[K, V]) Del ¶
func (ch *CompressedCache[K, V]) Del(k K)
func (*CompressedCache[K, V]) Get ¶
func (ch *CompressedCache[K, V]) Get(k K) (V, bool)
func (*CompressedCache[K, V]) GetTTL ¶
func (ch *CompressedCache[K, V]) GetTTL(k K) (time.Duration, bool)
func (*CompressedCache[K, V]) Set ¶
func (ch *CompressedCache[K, V]) Set(k K, v V) bool
func (*CompressedCache[K, V]) SetWithTTL ¶
func (ch *CompressedCache[K, V]) SetWithTTL(k K, v V, ttl time.Duration) bool
Click to show internal directories.
Click to hide internal directories.