bigcache

package
v0.0.0-...-2e7882b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package bigcache implements a BigCache driver for github.com/allegro/bigcache

Index

Constants

This section is empty.

Variables

View Source
var (
	// Codec is the codec used to marshal/unmarshal interfaces into the byte slices required by the Bigcache client
	Codec = codec.Gob
)

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() *Client

New returns a new client with the default bigcache parameters

func NewWithClient

func NewWithClient(bc *bigcache.BigCache) *Client

NewWithClient returns a new driver client with the given bigcache.BigCache configuration

func (*Client) Del

func (c *Client) Del(key string) error

Del implements the "cache.Cache".Del() interface

func (*Client) Exists

func (c *Client) Exists(key string) bool

Exists implements the "cache.Cache".Exists() interface

func (*Client) Get

func (c *Client) Get(key string, dstVal interface{}) error

Get implements the "cache.Cache".Get() interface

func (*Client) Set

func (c *Client) Set(key string, val interface{}, exp time.Duration) error

Set implements the "cache.Cache".Set() interface. Bigcache doesn't support expirations based on time, nor does it support deleting keys, so anything other than a 0 exp will result in an error.

Jump to

Keyboard shortcuts

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