cache

package
v0.0.0-...-e3fa223 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Exists(string) bool
	Get(string) ([]byte, error)
	Set(string, []byte) error
	Unset(string) error
}

func NewCacheFromConfig

func NewCacheFromConfig(cfg iiifconfig.CacheConfig) (Cache, error)

func NewDerivativesCacheFromConfig

func NewDerivativesCacheFromConfig(config *iiifconfig.Config) (Cache, error)

func NewImagesCacheFromConfig

func NewImagesCacheFromConfig(config *iiifconfig.Config) (Cache, error)

type DiskCache

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

func NewDiskCache

func NewDiskCache(cfg config.CacheConfig) (*DiskCache, error)

func (*DiskCache) Exists

func (c *DiskCache) Exists(rel_path string) bool

func (*DiskCache) Get

func (c *DiskCache) Get(rel_path string) ([]byte, error)

func (*DiskCache) Set

func (c *DiskCache) Set(rel_path string, body []byte) error

func (*DiskCache) Unset

func (c *DiskCache) Unset(rel_path string) error

type MemoryCache

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

func NewMemoryCache

func NewMemoryCache(cfg iiifconfig.CacheConfig) (*MemoryCache, error)

func (*MemoryCache) Exists

func (mc *MemoryCache) Exists(key string) bool

func (*MemoryCache) Get

func (mc *MemoryCache) Get(key string) ([]byte, error)

func (*MemoryCache) OnEvicted

func (mc *MemoryCache) OnEvicted(key string, value interface{})

func (*MemoryCache) Set

func (mc *MemoryCache) Set(key string, data []byte) error

func (*MemoryCache) Unset

func (mc *MemoryCache) Unset(key string) error

type NullCache

type NullCache struct {
	Cache
}

func NewNullCache

func NewNullCache(cfg config.CacheConfig) (*NullCache, error)

func (*NullCache) Exists

func (c *NullCache) Exists(rel_path string) bool

func (*NullCache) Get

func (c *NullCache) Get(rel_path string) ([]byte, error)

func (*NullCache) Set

func (c *NullCache) Set(rel_path string, body []byte) error

func (*NullCache) Unset

func (c *NullCache) Unset(rel_path string) error

type S3Cache

type S3Cache struct {
	S3 *iiifaws.S3Connection
}

func NewS3Cache

func NewS3Cache(cfg iiifconfig.CacheConfig) (*S3Cache, error)

func (*S3Cache) Exists

func (c *S3Cache) Exists(key string) bool

func (*S3Cache) Get

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

func (*S3Cache) Set

func (c *S3Cache) Set(key string, body []byte) error

func (*S3Cache) Unset

func (c *S3Cache) Unset(key string) error

Jump to

Keyboard shortcuts

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