bigcache

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package bigcache is a wrapper of the original "github.com/allegro/bigcache" library.

Only contains basic get, set, delete, and close methods. Data will be encoded to JSON before saving to cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is bigcache client.

func New

func New(expiredTime time.Duration) (*Client, error)

New to create new cache with default bigcache config.

func NewFromBigCache

func NewFromBigCache(bc *bigcache.BigCache) *Client

NewFromBigCache to create new cache from bigcache.

func NewWithConfig

func NewWithConfig(cfg bigcache.Config) (*Client, error)

NewWithConfig to create new cache with bigcache config.

func (*Client) Close

func (c *Client) Close() error

Close to close cache connection.

func (*Client) Delete

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

Delete to delete data from cache.

func (*Client) Get

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

Get to get data from cache.

func (*Client) Set

func (c *Client) Set(key string, data interface{}) error

Set to save data to cache.

Jump to

Keyboard shortcuts

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