memcached

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package memcached is a wrapper of github.com/bradfitz/gomemcache with Cache interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Add(*memcache.Item) error
	Get(key string) (*memcache.Item, error)
	Delete(string) error
	FlushAll() error
}

Client for memcached protocol

type Memcached

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

Memcached cache

func New

func New(ttl int32, servers ...string) *Memcached

New memcached client ttl is the cache expiration time, in seconds: either a relative time from now (up to 1 month), or an absolute Unix epoch time. Zero means the Item has no expiration time.

func (*Memcached) Get

func (c *Memcached) Get(key interface{}) interface{}

Get item from cache

func (*Memcached) Has

func (c *Memcached) Has(key interface{}) bool

Has item in cache

func (*Memcached) Purge

func (c *Memcached) Purge()

Purge all cache

func (*Memcached) Remove

func (c *Memcached) Remove(key interface{})

Remove item from cache

func (*Memcached) Set

func (c *Memcached) Set(key interface{}, value interface{})

Set item to cache

Jump to

Keyboard shortcuts

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