files

package
v0.0.0-...-e26ef75 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

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

Local is an implementation of the Storage interface which works with the local disk on the current machine

func NewLocal

func NewLocal(basePath string) (*Local, error)

NewLocal creates a new Local filesytem with the given base path basePath is the base directory to save files to

func (*Local) Save

func (l *Local) Save(path string, contents io.Reader) error

Save the contents of the Writer to the given path path is a relative path, basePath will be appended

type Storage

type Storage interface {
	Save(path string, file io.Reader) error
}

Storage defines the behavior for file operations Implementations may be of the time local disk, or cloud storage, etc

Jump to

Keyboard shortcuts

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