filesystem

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 14 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) (provider.ReadSeekerCloser, 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) Store added in v0.8.0

func (a *App) Store(pathname string, content io.ReadCloser) error

Store file to 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)

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 ByHybridSort

type ByHybridSort []provider.StorageItem

ByHybridSort implements Sorter by type, name then modification time

func (ByHybridSort) Len

func (a ByHybridSort) Len() int

func (ByHybridSort) Less

func (a ByHybridSort) Less(i, j int) bool

func (ByHybridSort) Swap

func (a ByHybridSort) Swap(i, j int)

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