file

package
v1.3.71 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: BSD-3-Clause Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalLoader

type LocalLoader struct {
	// StoragePath is the main folder to save into
	Path     string
	OpenFunc OpenFileReadFunc
}

LocalLoader loads file on local disk

func NewLocalLoader

func NewLocalLoader(path string) (*LocalLoader, error)

NewLocalLoader creates LocalLoader instance

func (LocalLoader) Load

func (fs LocalLoader) Load(name string) (api.FileRead, error)

Load loads file from disk

type LocalSaver

type LocalSaver struct {
	// StoragePath is the main folder to save into
	StoragePath  string
	OpenFileFunc OpenFileFunc
}

LocalSaver saves file on local disk

func NewLocalSaver

func NewLocalSaver(storagePath string) (*LocalSaver, error)

NewLocalSaver creates LocalSaver instance

func (LocalSaver) Save

func (fs LocalSaver) Save(name string, reader io.Reader) error

Save saves file to disk

type OldDirProvider added in v0.3.49

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

OldDirProvider returns old directories to remove from a system

func NewOldDirProvider added in v0.3.49

func NewOldDirProvider(expireDuration time.Duration, dir string) (*OldDirProvider, error)

NewOldDirProvider creates OldDirProvider instances

func (*OldDirProvider) GetExpired added in v0.3.49

func (p *OldDirProvider) GetExpired() ([]string, error)

GetExpired return expired file nams

type OpenFileFunc

type OpenFileFunc func(fileName string) (WriterCloser, error)

OpenFileFunc declares function to open file by name and return Writer

type OpenFileReadFunc

type OpenFileReadFunc func(fileName string) (api.FileRead, error)

OpenFileReadFunc declares function to open file by name and return Reader

type WriterCloser

type WriterCloser interface {
	io.Writer
	Close() error
}

WriterCloser keeps Writer interface and close function

Jump to

Keyboard shortcuts

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