memory

package
v0.0.0-...-93f578c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorType = fmt.Errorf("type error")
)

Functions

This section is empty.

Types

type Cache

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

func NewByteCache

func NewByteCache() *Cache[[]byte]

func NewMemoryCache

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

func (*Cache[T]) Close

func (m *Cache[T]) Close() error

func (*Cache[T]) Del

func (m *Cache[T]) Del(ctx context.Context, key string) error

func (*Cache[T]) DelAll

func (m *Cache[T]) DelAll(ctx context.Context) error

func (*Cache[T]) Get

func (m *Cache[T]) Get(ctx context.Context, key string) (*T, error)

func (*Cache[T]) MultiDel

func (m *Cache[T]) MultiDel(ctx context.Context, keys []string) error

func (*Cache[T]) MultiGet

func (m *Cache[T]) MultiGet(ctx context.Context, keys []string) (map[string]T, error)

func (*Cache[T]) MultiSet

func (m *Cache[T]) MultiSet(ctx context.Context, valMap map[string]T, expiration time.Duration) error

func (*Cache[T]) Set

func (m *Cache[T]) Set(ctx context.Context, key string, val T, expiration time.Duration) error

Jump to

Keyboard shortcuts

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