store

package
v0.0.0-...-10117e9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2018 License: MIT Imports: 16 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 {
	Store
	LoadCache(walkFn func(item interface{}) error) error
	PruneCache() error
}

type FileCache

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

func NewFileCache

func NewFileCache(root string, maxSize int64, nShards int) *FileCache

func (*FileCache) Get

func (fc *FileCache) Get(filename string) ([]byte, error)

func (*FileCache) LoadCache

func (fc *FileCache) LoadCache(walkFn func(item interface{}) error) error

func (*FileCache) PruneCache

func (fc *FileCache) PruneCache() error

func (*FileCache) Put

func (fc *FileCache) Put(filename string, buf []byte) error

func (*FileCache) Remove

func (fc *FileCache) Remove(filename string) error

type FileStore

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

func NewFileStore

func NewFileStore(root string) *FileStore

func (*FileStore) Get

func (s *FileStore) Get(filename string) ([]byte, error)

func (*FileStore) Put

func (s *FileStore) Put(filename string, buf []byte) error

func (*FileStore) Remove

func (s *FileStore) Remove(filename string) error

type NoopCache

type NoopCache struct{}

func (*NoopCache) Get

func (c *NoopCache) Get(filename string) ([]byte, error)

func (*NoopCache) LoadCache

func (c *NoopCache) LoadCache(walkFn func(item interface{}) error) error

func (*NoopCache) PruneCache

func (c *NoopCache) PruneCache() error

func (*NoopCache) Put

func (c *NoopCache) Put(filename string, buf []byte) error

func (*NoopCache) Remove

func (c *NoopCache) Remove(filename string) error

type S3Config

type S3Config struct {
	Region string
	Bucket string
	Prefix string
}

type S3Store

type S3Store struct {
	S3 *s3.S3
	// contains filtered or unexported fields
}

func NewS3Store

func NewS3Store(config *S3Config) (*S3Store, error)

func (*S3Store) Get

func (s *S3Store) Get(filename string) ([]byte, error)

func (*S3Store) Put

func (s *S3Store) Put(filename string, buf []byte) error

func (*S3Store) Remove

func (s *S3Store) Remove(filename string) error

type Store

type Store interface {
	Get(filename string) ([]byte, error)
	Put(filename string, buf []byte) error
	Remove(filename string) error
}

type TwoTier

type TwoTier struct {
	Store Store
	Cache Cache
}

func (*TwoTier) Get

func (s *TwoTier) Get(filename string) ([]byte, error)

func (*TwoTier) LoadCache

func (s *TwoTier) LoadCache(walkFn func(item interface{}) error) error

func (*TwoTier) PruneCache

func (s *TwoTier) PruneCache() error

func (*TwoTier) Put

func (s *TwoTier) Put(filename string, data []byte) error

func (*TwoTier) Remove

func (s *TwoTier) Remove(filename string) error

Jump to

Keyboard shortcuts

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