cache

package
v0.0.67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](costFunc func(T) int64, cacheType string) (*Cache[T], error)

func (*Cache[T]) Clear

func (c *Cache[T]) Clear()

func (*Cache[T]) Del added in v0.0.56

func (c *Cache[T]) Del(key string)

func (*Cache[T]) Get

func (c *Cache[T]) Get(key string) (T, bool)

func (*Cache[T]) GetItemCount

func (c *Cache[T]) GetItemCount() int64

func (*Cache[T]) SetWithTTL

func (c *Cache[T]) SetWithTTL(key string, value T, cost int64,
	ttl time.Duration) bool

func (*Cache[T]) Stats

func (c *Cache[T]) Stats() map[string]interface{}

func (*Cache[T]) StatsCopy

func (c *Cache[T]) StatsCopy() map[string]interface{}

func (*Cache[T]) Wait added in v0.0.56

func (c *Cache[T]) Wait()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL