Files
storage/memcache
2020-11-05 09:16:20 +01:00
..
2020-11-05 04:17:05 +01:00
2020-11-05 09:16:20 +01:00
2020-11-05 09:16:20 +01:00
2020-11-05 05:58:52 +01:00
2020-11-05 06:08:05 +01:00
2020-11-05 06:18:29 +01:00

Memcache

A Memcache storage driver using bradfitz/gomemcache.

Table of Contents

Signatures

func New(config ...Config) Storage

Examples

Import the storage package.

import "github.com/gofiber/storage/memcache"

You can use the following possibilities to create a storage:

// Initialize default config
store := memcache.New()

// Initialize custom config
store := memcache.New(memcache.Config{
	Servers: "localhost:11211",
})

Config

type Config struct {
	// Server list divided by ,
	// i.e. server1:11211, server2:11212
	//
	// Optional. Default is "127.0.0.1:11211"
	Servers string

	// Clear any existing keys in existing Table
	//
	// Optional. Default is false
	Clear bool
}

Default Config

var ConfigDefault = Config{
	Servers:      "127.0.0.1:11211",
}