filesystem

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRelativePath occurs when path is relative (contains ".."")
	ErrRelativePath = errors.New("pathname contains relatives paths")
)

Functions

This section is empty.

Types

type App added in v0.8.0

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

App of the package

func New

func New(config Config) (App, error)

New creates new App from Config

func (App) CreateDir added in v0.8.0

func (a App) CreateDir(name string) error

CreateDir container in storage

func (App) Info added in v0.8.0

func (a App) Info(pathname string) (provider.StorageItem, error)

Info provide metadata about given pathname

func (App) List added in v0.8.0

func (a App) List(pathname string) ([]provider.StorageItem, error)

List items in the storage

func (App) ReaderFrom added in v0.8.0

func (a App) ReaderFrom(pathname string) (io.ReadSeekCloser, error)

ReaderFrom reads content from given pathname

func (App) Remove added in v0.8.0

func (a App) Remove(pathname string) error

Remove file or directory from storage

func (App) Rename added in v0.8.0

func (a App) Rename(oldName, newName string) error

Rename file or directory from storage

func (App) UpdateDate added in v0.8.0

func (a App) UpdateDate(pathname string, date time.Time) error

UpdateDate update date from given value

func (App) Walk added in v0.8.0

func (a App) Walk(pathname string, walkFn func(provider.StorageItem, error) error) error

Walk browses item recursively

func (App) WithIgnoreFn added in v0.8.0

func (a App) WithIgnoreFn(ignoreFn func(provider.StorageItem) bool) provider.Storage

WithIgnoreFn create a new App with given ignoreFn

func (App) WriterTo added in v0.8.0

func (a App) WriterTo(pathname string) (io.WriteCloser, error)

WriterTo opens writer for given pathname

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string) Config

Flags adds flags for configuring package

Jump to

Keyboard shortcuts

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