cache

package
v4.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobCache

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

func (*BlobCache) Exists

func (bc *BlobCache) Exists(uri string) bool

func (*BlobCache) Get

func (bc *BlobCache) Get(uri string) ([]byte, error)

func (*BlobCache) Set

func (bc *BlobCache) Set(uri string, body []byte) error

func (*BlobCache) Unset

func (bc *BlobCache) Unset(uri string) error

type Cache

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

func NewBlobCache

func NewBlobCache(config iiifconfig.CacheConfig) (Cache, error)

func NewBlobCacheFromURI

func NewBlobCacheFromURI(uri string) (Cache, error)

func NewCacheFromConfig

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

func NewDerivativesCacheFromConfig

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

func NewDiskCache

func NewDiskCache(cfg config.CacheConfig) (Cache, error)

func NewImagesCacheFromConfig

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

func NewS3Cache

func NewS3Cache(cfg iiifconfig.CacheConfig) (Cache, 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

Jump to

Keyboard shortcuts

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