store

package
v0.0.0-...-c14ca32 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMongoHost = errors.New("parameter 'url' is empty")

ErrNoMongoHost is returned if no[[host]:port] combination for MongoDB was provided,

Functions

This section is empty.

Types

type FileStore

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

FileStore represents a filesystem based file Repository.

func NewFile

func NewFile(base string) (*FileStore, error)

NewFile creates a new filesystem based file Repository.

func (*FileStore) Close

func (s *FileStore) Close() error

Close satisfies the Repository interface, but is a noop for a filesystem based repo.

func (*FileStore) StreamFrom

func (s *FileStore) StreamFrom(path string, w io.Writer) (err error)

StreamFrom statisfies the Retriever interface.

func (*FileStore) StreamTo

func (s *FileStore) StreamTo(path string, source io.Reader) (err error)

StreamTo satisfies the Storer interface.

type MongoDBStore

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

MongoDBStore represents a GridFS based file Repository.

func NewMongoDB

func NewMongoDB(url, user, pass, db, name string) (store *MongoDBStore, err error)

NewMongoDB creates a GridFS based repository.

func (MongoDBStore) Close

func (s MongoDBStore) Close() error

Close satisfies the Repository interface.

func (MongoDBStore) StreamFrom

func (s MongoDBStore) StreamFrom(path string, w io.Writer) (err error)

StreamFrom statisfies the Retriever interface.

func (MongoDBStore) StreamTo

func (s MongoDBStore) StreamTo(path string, source io.Reader) (err error)

StreamTo satisfies the Storer interface.

Jump to

Keyboard shortcuts

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