esicache

package
v0.0.0-...-581f9c8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2017 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package esicache provides integrations for cache services which store content from backend resources.

Index

Constants

This section is empty.

Variables

View Source
var MainRegistry = &registry{
	caches: make(map[string]Caches),
}

MainRegistry global cache registry

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	Set(key string, value []byte, expiration time.Duration) error
	Get(key string) ([]byte, error)
}

Cacher used to cache the response of a micro service as found in the src attribute of an ESI tag. But the Cacher gets only involved if the additional attribute ttl has been set for each ESI tag. A Cacher must be thread safe.

func NewCacher

func NewCacher(url string) (Cacher, error)

NewCacher creates a new cache service object and its connection as defined by its URL.

type Caches

type Caches []Cacher

Caches gets set during config reading and implements Cacher interface

func (Caches) Get

func (c Caches) Get(key string) ([]byte, error)

Get fetches from the cache service

func (Caches) Set

func (c Caches) Set(key string, value []byte, expiration time.Duration) error

Set writes to the cache service

Jump to

Keyboard shortcuts

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