simplecache

package module
v0.0.0-...-af5cd25 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleCache

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

func NewSimpleCache

func NewSimpleCache() *SimpleCache

func (*SimpleCache) Close

func (c *SimpleCache) Close()

func (*SimpleCache) Delete

func (c *SimpleCache) Delete(key sdk.KeyInfo)

Delete record specified by key.Key If the record has been overwriten it will not be deleted

func (*SimpleCache) Insert

func (c *SimpleCache) Insert(key sdk.KeyInfo, rec sdk.Record)

Insert a new record or overwrite existed one. TODO remove unnessasery copy of []bytes here

func (*SimpleCache) Lookup

func (c *SimpleCache) Lookup(key sdk.KeyInfo) (sdk.Record, bool)

Search for record equal to KeyInfo.Key which is not expired at the moment of KeyInfo.Expires TODO remove unnessasery copy of []bytes here

func (*SimpleCache) WatchSheduler

func (c *SimpleCache) WatchSheduler(sched sdk.Scheduler)

Reading records from chan and call Expired func. Should be run in a separete goroutine

Jump to

Keyboard shortcuts

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