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

memcached

package
v0.9.81 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 9 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(*Wrapper, *memcache.Client)

func WithConnectRetryBackoff

func WithConnectRetryBackoff(initial time.Duration, max time.Duration) Option

func WithConnectRetryTimeout

func WithConnectRetryTimeout(timeout time.Duration) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

func WithMaxIdleConns

func WithMaxIdleConns(maxIdleConns int) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Wrapper

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

func Open

func Open(ctx context.Context, hosts []string, opts ...Option) (*Wrapper, error)

func (*Wrapper) AllowRateLimit

func (w *Wrapper) AllowRateLimit(
	ctx context.Context,
	key string,
	interval time.Duration,
	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