cache

package
v2.0.0-alpha-1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheMiss = errors.New("gphotos: cache miss")

ErrCacheMiss is returned when a object is not found in cache.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// contains filtered or unexported methods
}

type CachitaCache

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

CachitaCache implements Cache with `gadelkareem/cachita` package.

func NewCachitaCache

func NewCachitaCache() *CachitaCache

func (*CachitaCache) GetAlbum

func (c *CachitaCache) GetAlbum(ctx context.Context, title string) (*photoslibrary.Album, error)

Get reads an object data from the cache.

func (*CachitaCache) InvalidateAlbum

func (c *CachitaCache) InvalidateAlbum(ctx context.Context, title string) error

InvalidateAlbum removes the specified Album from the cache.

func (*CachitaCache) PutAlbum

func (c *CachitaCache) PutAlbum(ctx context.Context, album *photoslibrary.Album, ttl time.Duration) error

Put store an object data to the cache.

Jump to

Keyboard shortcuts

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