caches

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 2 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 {
	Get(key string) ([]byte, error)
	Set(key string, val []byte) error
	Has(key string) bool
}

type CacheOptions

type CacheOptions struct {
	UseCache bool `default:"false" name:"cache.activate" desc:"Activate the cache."`
	InfoJSON bool `default:"true" name:"cache.infojson" desc:"Cache info.json responses."`
	Tiles    bool `default:"true" name:"cache.tiles" desc:"Cache tiles."`
	Size     int  `default:"128" name:"cache.size" desc:"The size of the cache in MB."`
}

type FastCache

type FastCache struct {
	Cache
	Client *fastcache.Cache
	Size   int
}

func NewFastCache

func NewFastCache(size int) (*FastCache, error)

func (*FastCache) Get

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

func (*FastCache) Has

func (c *FastCache) Has(key string) bool

func (*FastCache) Set

func (c *FastCache) Set(key string, val []byte) error

type NullCache

type NullCache struct {
	Cache
}

func NewNullCache

func NewNullCache() (*NullCache, error)

func (*NullCache) Get

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

func (*NullCache) Has

func (c *NullCache) Has(key string) bool

func (*NullCache) Set

func (c *NullCache) Set(key string, val []byte) error

Jump to

Keyboard shortcuts

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