cache

package
v0.8.19 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout time.Duration = 30 * time.Minute

Functions

This section is empty.

Types

type Cache

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

func New

func New[T any]() *Cache[T]

func NewWithTimeout added in v0.6.3

func NewWithTimeout[T any](dur time.Duration) *Cache[T]

func (*Cache[T]) Get

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

func (*Cache[T]) Set

func (ct *Cache[T]) Set(key string, value T)

type CacheProvider added in v0.8.2

type CacheProvider[T any] interface {
	Set(key string, value T)
	Get(key string) (T, bool)
}

func NewCacheProvider added in v0.8.2

func NewCacheProvider[T any](t time.Duration) CacheProvider[T]

type CacheRam added in v0.8.2

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

func (*CacheRam[T]) Get added in v0.8.2

func (cc *CacheRam[T]) Get(key string) (T, bool)

func (*CacheRam[T]) Set added in v0.8.2

func (cc *CacheRam[T]) Set(key string, value T)

Jump to

Keyboard shortcuts

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