cache

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	Has(key string) (bool, error)
	Put(key string, reader io.Reader) error
	Get(key string) (io.Reader, error)
	String() string
}

Cacher represents a cache

func NewLocalCache

func NewLocalCache(dir string) (Cacher, error)

NewLocalCache creates a new LocalCache

type LocalCache

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

LocalCache represents a local cache instance

func (*LocalCache) Get

func (cache *LocalCache) Get(key string) (io.Reader, error)

Get fetches something from the cache

func (*LocalCache) Has

func (cache *LocalCache) Has(key string) (bool, error)

Has indicates whether a LocalCache contains a given key or not

func (*LocalCache) Put

func (cache *LocalCache) Put(key string, reader io.Reader) error

Put stores something in the cache

func (*LocalCache) String

func (cache *LocalCache) String() string

type MinioCache

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

MinioCache represents a Minio Cache instance

func NewMinioCache

func NewMinioCache(endpoint string, accessKeyID string, secretAccessKey string, bucket string, useTLS bool) *MinioCache

NewMinioCache creates a new Minio Cache

func (*MinioCache) Dial

func (cache *MinioCache) Dial() error

Dial connects to a Minio instance

func (*MinioCache) Get

func (cache *MinioCache) Get(key string) (io.Reader, error)

Get fetches something from the cache

func (*MinioCache) Has

func (cache *MinioCache) Has(key string) (bool, error)

Has determines whether or not Minio contains a given key

func (*MinioCache) Put

func (cache *MinioCache) Put(key string, reader io.Reader) error

Put stores something in the cache TODO: Test with inputs larger than 128 MiB

func (*MinioCache) String

func (cache *MinioCache) String() string

Jump to

Keyboard shortcuts

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