filesystem

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const Name = "fs"

Name of the storage implementation

Variables

View Source
var ErrRelativePath = errors.New("pathname contains relatives paths")

ErrRelativePath occurs when path is relative (contains ".."")

Functions

This section is empty.

Types

type App

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

App of the package

func New

func New(directory string) (App, error)

New creates new App from Config

func (App) CreateDir

func (a App) CreateDir(name string) error

CreateDir container in storage

func (App) Enabled added in v0.0.2

func (a App) Enabled() bool

Enabled checks that requirements are met

func (App) Info

func (a App) Info(pathname string) (model.Item, error)

Info provide metadata about given pathname

func (App) List

func (a App) List(pathname string) ([]model.Item, error)

List items in the storage

func (App) Name added in v0.0.3

func (a App) Name() string

Name of the sotrage

func (App) Path added in v0.0.3

func (a App) Path(pathname string) string

Path return full path of pathname

func (App) ReaderFrom

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

ReaderFrom reads content from given pathname

func (App) Remove

func (a App) Remove(pathname string) error

Remove file or directory from storage

func (App) Rename

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

Rename file or directory from storage

func (App) UpdateDate

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

UpdateDate update date from given value

func (App) Walk

func (a App) Walk(pathname string, walkFn func(model.Item) error) error

Walk browses item recursively

func (App) WithIgnoreFn

func (a App) WithIgnoreFn(ignoreFn func(model.Item) bool) model.Storage

WithIgnoreFn create a new App with given ignoreFn

func (App) WriterTo

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

WriterTo opens writer for given pathname

Jump to

Keyboard shortcuts

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