file

package
v0.0.0-...-8150c3c Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 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 @storage interface which works with the local storage

func NewLocalStorage

func NewLocalStorage(basePath string, maxFileSize int) (*Local, error)

NewLocalStorage create a new @Local filesystem

func (*Local) Get

func (l *Local) Get(id string) (*os.File, error)

Get the file for the specified loaction

func (*Local) Save

func (l *Local) Save(id string, content io.ReadCloser) error

Save the content of the reader to the path location path is relative, will be appended to Local.basePath

type Storage

type Storage interface {
	Save(id string, file io.ReadCloser) error
	Get(id string) (*os.File, error)
}

Storage defines the behavior for files Implementations may choose to save the file locally, in a db or upload it in the cloud

Jump to

Keyboard shortcuts

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