storage

package
v0.0.0-...-e31cc93 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileDoesNotExists = errors.New("storage : File does not exist")

Functions

This section is empty.

Types

type FilerStorage

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

FilerStorage is a storage types that embed afero in other to save files in multiple storage systems

func NewFilerStorage

func NewFilerStorage(fs afero.Fs, pathGenerator PathFunc) *FilerStorage

func (*FilerStorage) Delete

func (l *FilerStorage) Delete(path string) error

func (*FilerStorage) Exists

func (l *FilerStorage) Exists(path string) (bool, error)

func (*FilerStorage) URL

func (l *FilerStorage) URL(path string) string

func (*FilerStorage) Write

func (l *FilerStorage) Write(path string, r io.Reader) error

type PathFunc

type PathFunc func(path string) string

PathFunc is a path generator. Manipulate as wish in other to save files as per the app.

type Store

type Store interface {
	Write(path string, r io.Reader) error
	Delete(path string) error
	URL(path string) string
	Exists(path string) (bool, error)
}

Store defines the interactins available for all storage drivers

Jump to

Keyboard shortcuts

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