storage

package
v0.0.0-...-cc73b8b Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(resource string, id string) (bool, error)

Delete will orchestrate deletion in the persistency going to the database and than invalidating cache

func Load

func Load(resource string, id string) (exists bool, value interface{})

Load will orchestrate fetching from the persistency trying to load from cache first, then from database

func Save

func Save(resource, id string, value interface{}) error

Save will orchesrtate saving from the persistency, inserting to the database first, then creating a cache key

Types

type GlobalMemoryCache

type GlobalMemoryCache struct {
	Mcache *ccache.Cache
}

GlobalMemoryCache is the model that holds the memory cache

var GlobalCache *GlobalMemoryCache

GlobalCache is a single-instance accessor for the memory cache

func GetGlobalCache

func GetGlobalCache() *GlobalMemoryCache

GetGlobalCache is a helper function to get our cache storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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