files

package
v0.0.0-...-5a726a0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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 struct represents a local storage

func NewLocal

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

NewLocal creates a new local struct with given basePath and maxSize of the files

func (*Local) Get

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

Get returns contents of a specific path or file

func (*Local) Save

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

Save is implemented from the Storage interface and it will save contents to a specific file.

type Storage

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

Storage interface will represent a storage for this application

Jump to

Keyboard shortcuts

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