lru

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: ISC Imports: 4 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 struct {
	// contains filtered or unexported fields
}

func New

func New(options Options) (*Cache, error)

func (*Cache) Del

func (mc *Cache) Del(key string) error

func (*Cache) Get

func (mc *Cache) Get(key string, dst any) error

func (*Cache) GetBytes

func (mc *Cache) GetBytes(key string) ([]byte, error)

func (*Cache) Has

func (mc *Cache) Has(key string) bool

func (*Cache) Set

func (mc *Cache) Set(key string, val any, ttl time.Duration) error

type Options

type Options struct {
	Encoder encoder.Encoder `default:"msgpack"`
	Size    int             `default:"128"`
}

Jump to

Keyboard shortcuts

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