cache

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 5 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 interface {
	Del(k []byte) error
	Get(k []byte) ([]byte, error)
	Put(k []byte, v []byte, timeOut time.Time) error
}

func NewRedis

func NewRedis(addr, pass string) Cache

type CacheHelp

type CacheHelp[T any] struct {
	Cache
}

func (CacheHelp[T]) Get

func (c CacheHelp[T]) Get(k []byte) (T, error)

func (CacheHelp[T]) Put

func (c CacheHelp[T]) Put(k []byte, v T, timeOut time.Time) error

type FastCache

type FastCache struct {
	// contains filtered or unexported fields
}

func NewFastCache

func NewFastCache(maxBytes int) *FastCache

func (*FastCache) Del

func (f *FastCache) Del(k []byte) error

func (*FastCache) Get

func (f *FastCache) Get(k []byte) ([]byte, error)

func (*FastCache) Put

func (f *FastCache) Put(k []byte, v []byte, timeOut time.Time) error

Jump to

Keyboard shortcuts

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