ponzi

package module
v0.0.0-...-468a969 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: MIT Imports: 7 Imported by: 1

README

Ponzi

Caching middle layer for Ponzu content

More docs soon

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cached provides an in-memory read- and write-through cache for ponzu

func New

func New(baseURL string, ttl time.Duration, purge time.Duration) *Cache

New returns a new Cache with `ttl` duration that purges at `purge` intervals.

New("https://mycms.com", 5*time.Minute, 30*time.Second)

func (*Cache) Get

func (c *Cache) Get(id int, contentType string, result interface{}) error

Get returns a single item of content

func (*Cache) GetAll

func (c *Cache) GetAll(contentType string, result interface{}) error

GetAll returns all items

func (*Cache) GetBySlug

func (c *Cache) GetBySlug(slug string, contentType string, result interface{}) error

GetBySlug returns a single item of content

Jump to

Keyboard shortcuts

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