memcachedcache

package module
v0.1.5 Latest Latest
Warning

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

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

Documentation

Overview

Package memcachedcache provides a Memcached-backed cache.Store implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) cachecore.Store

New builds a Memcached-backed cachecore.Store.

Defaults: - Addresses: []string{"127.0.0.1:11211"} when empty - DefaultTTL: 5*time.Minute when zero - Prefix: "app" when empty

Example: memcached cluster via explicit driver config

store := memcachedcache.New(memcachedcache.Config{
	BaseConfig: cachecore.BaseConfig{
		DefaultTTL: 5 * time.Minute,
		Prefix:     "app",
	},
	Addresses: []string{"127.0.0.1:11211"},
})
fmt.Println(store.Driver()) // memcached

Types

type Config

type Config struct {
	cachecore.BaseConfig
	Addresses []string
}

Config configures a Memcached-backed cache store.

Jump to

Keyboard shortcuts

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