Help us shape the future of Go! Take the 2026 Go Developer Survey

local

package
v0.9.78 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config)

func WithCapacity

func WithCapacity(capacity uint64) Option

WithCapacity sets the maximum number of entries. Zero disables the limit.

func WithMaxCostBytes

func WithMaxCostBytes(maxCostBytes uint64) Option

WithMaxCostBytes sets the maximum combined size of cached keys and values. Zero disables the limit; cache bookkeeping overhead is not included.

type Wrapper

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

func New

func New(opts ...Option) *Wrapper

func (*Wrapper) AllowRateLimit

func (w *Wrapper) AllowRateLimit(
	_ context.Context,
	key string,
	rate int,
	burst int,
	ttl time.Duration,
) (bool, error)

func (*Wrapper) Get

func (w *Wrapper) Get(_ context.Context, key string) (string, bool, error)

func (*Wrapper) Invalidate

func (w *Wrapper) Invalidate(_ context.Context, key string) error

func (*Wrapper) Ping

func (w *Wrapper) Ping(ctx context.Context) error

func (*Wrapper) Set

func (w *Wrapper) Set(_ context.Context, key string, value string, ttl time.Duration) error

func (*Wrapper) SetIfAbsent

func (w *Wrapper) SetIfAbsent(
	_ context.Context,
	key string,
	value string,
	ttl time.Duration,
) (bool, error)

func (*Wrapper) Shutdown

func (w *Wrapper) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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