cache

package
v0.0.0-...-b9f95b1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package cache data TTL cache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	Data           interface{}
	ExpirationTime int64
}

func (*CacheEntry) IsExpired

func (ce *CacheEntry) IsExpired() bool

type CacheManager

type CacheManager struct {
	CheckingTime          int64
	DefaultExpirationTime int64
	Entries               map[uint32]CacheEntry
}

func MustNewCacheManager

func MustNewCacheManager(defaultExpiration int64, checkingTime int64) *CacheManager

func NewCacheManager

func NewCacheManager(defaultExpiration int64, checkingTime int64) (*CacheManager, error)

func (*CacheManager) Add

func (cm *CacheManager) Add(entry uint32, data interface{})

func (*CacheManager) AutoCacheCleaner

func (cm *CacheManager) AutoCacheCleaner()

func (*CacheManager) DeleteEntry

func (cm *CacheManager) DeleteEntry(entry uint32)

func (*CacheManager) Exists

func (cm *CacheManager) Exists(entry uint32) bool

func (*CacheManager) Get

func (cm *CacheManager) Get(entry uint32) interface{}

func (*CacheManager) GetKeys

func (cm *CacheManager) GetKeys() []uint32

func (*CacheManager) Invalidate

func (cm *CacheManager) Invalidate()

func (*CacheManager) PerformCleanup

func (cm *CacheManager) PerformCleanup()

func (*CacheManager) ResetTimer

func (cm *CacheManager) ResetTimer(entry uint32)

Jump to

Keyboard shortcuts

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