aecache

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

App Engine cache layers

Build Status Godoc

Bugs, comments, questions: create a new issue.

Documentation

Overview

Package aecache implements layers of caching for App Engine.

It provides 2 layers of caching:

  • process memory
  • cloud datastore

And combines them to provide a layered cache, fastest to slowest.

It only caches bytes, on top of which you can use encodings (json, gob, etc). Faster cache layers are refilled automatically from lower ones when hit. Values expires strictly after provided expiration.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCacheMiss is when key is not found.
	ErrCacheMiss = errors.New("cache: miss")
	// ErrTooBig is when a value is too big to fit in the cache.
	ErrTooBig = errors.New("cache: too big")
)

Errors returned by this package.

Functions

func Clean added in v1.2.0

func Clean(ctx context.Context) error

Clean deletes expired items.

func Get

func Get(ctx context.Context, key string) ([]byte, time.Time, error)

Get gets the value and expiration for a key.

func Set

func Set(ctx context.Context, key string, value []byte, expiration time.Duration) error

Set sets a key to a value with an expiration.

Types

This section is empty.

Directories

Path Synopsis
Package internal holds exported structures for Cloud Datastore.
Package internal holds exported structures for Cloud Datastore.

Jump to

Keyboard shortcuts

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