clevercache

package module
v0.0.0-...-8349e1e Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2014 License: Apache-2.0 Imports: 3 Imported by: 0

README

clevercache

A caching library that automatically loads data on a miss

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx gctx.Context) interface{}

Get the cacheing engine from the context

func NewContext

func NewContext(ctx gctx.Context, engine interface{}) gctx.Context

Return a new context with the required cacheing engine embedded

Types

type Clevercacher

type Clevercacher interface {
	Get(ctx gctx.Context, key interface{}, params map[string]interface{}) (value interface{}, hit bool, err error)
	Set(ctx gctx.Context, key interface{}, value interface{}, params map[string]interface{}) (err error)
	Data(ctx gctx.Context, key interface{}, params map[string]interface{}) (value interface{}, err error)
}

type Client

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

The client used to interact with the library and the cacheing engine used

func New

func New() *Client

Return a new client

func (*Client) Get

func (cl *Client) Get(ctx gctx.Context, key interface{}, params map[string]interface{}) (value interface{}, err error)

func (*Client) RegisterCache

func (cl *Client) RegisterCache(c Clevercacher)

add the cacheing engine to the client

func (*Client) Set

func (cl *Client) Set(ctx gctx.Context, key interface{}, value interface{}, params map[string]interface{}) (err error)

Directories

Path Synopsis
This is an example cacheing engine for use with the clevercache package
This is an example cacheing engine for use with the clevercache package

Jump to

Keyboard shortcuts

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