cachemdl

package
v0.0.0-...-706786d Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cachemdl will help cache object into memory. It Uses LRU algo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheGCHelper

type CacheGCHelper struct {
	GC         gcache.Cache
	Expiration time.Duration
	MaxEntries int
}

CacheGCHelper use this to create new cache object Remember it holds memory

func (*CacheGCHelper) Count

func (gchelper *CacheGCHelper) Count() int

Count all objects

func (*CacheGCHelper) Get

func (gchelper *CacheGCHelper) Get(key string) (interface{}, error)

Get object based on key

func (*CacheGCHelper) GetAll

func (gchelper *CacheGCHelper) GetAll() map[interface{}]interface{}

GetAll objects from gc

func (*CacheGCHelper) Purge

func (gchelper *CacheGCHelper) Purge()

Purge all objects

func (*CacheGCHelper) Remove

func (gchelper *CacheGCHelper) Remove(key string) bool

Remove object from GC

func (*CacheGCHelper) Set

func (gchelper *CacheGCHelper) Set(key string, object interface{}) error

New Add new Key and value

func (*CacheGCHelper) Setup

func (gchelper *CacheGCHelper) Setup(MaxEntries int, Expiration time.Duration)

Setup create new object of GC

Jump to

Keyboard shortcuts

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