ristretto

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NumCounters int64
	MaxCost     int64
	BufferItems int64
}

type RistrettoCacher

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

func NewRistretto

func NewRistretto(config Config) (*RistrettoCacher, error)

func (*RistrettoCacher) Bytes

func (m *RistrettoCacher) Bytes(ctx context.Context, key string) (bytes []byte, err error)

Bytes implements cacher.Cacher

func (*RistrettoCacher) BytesMany

func (m *RistrettoCacher) BytesMany(ctx context.Context, keys ...string) (map[string][]byte, error)

BytesMany implements cacher.Cacher

func (*RistrettoCacher) Close

func (m *RistrettoCacher) Close() (err error)

Close implements cacher.Cacher

func (*RistrettoCacher) Delete

func (m *RistrettoCacher) Delete(ctx context.Context, key string) (err error)

Delete implements cacher.Cacher

func (*RistrettoCacher) DeleteMany

func (m *RistrettoCacher) DeleteMany(ctx context.Context, keys ...string) error

DeleteMany implements cacher.Cacher

func (*RistrettoCacher) Exists

func (m *RistrettoCacher) Exists(ctx context.Context, key string) (bool, error)

Exists implements cacher.Cacher

func (*RistrettoCacher) Set

func (m *RistrettoCacher) Set(ctx context.Context, key string, bytes []byte, duration time.Duration) (err error)

Set implements cacher.Cacher

func (*RistrettoCacher) SetMany

func (m *RistrettoCacher) SetMany(ctx context.Context, items map[string][]byte) (err error)

SetMany implements cacher.Cacher

func (*RistrettoCacher) SetManyExp

func (m *RistrettoCacher) SetManyExp(ctx context.Context, items map[string][]byte, ttl time.Duration) (err error)

SetManyExp implements cacher.Cacher

Jump to

Keyboard shortcuts

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