filesystem

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 11 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) ConvertError added in v0.3.4

func (a App) ConvertError(err error) error

ConvertError with the appropriate type

func (App) CreateDir

func (a App) CreateDir(ctx context.Context, 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(ctx context.Context, pathname string) (model.Item, error)

Info provide metadata about given pathname

func (App) List

func (a App) List(ctx context.Context, 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) ReadFrom added in v0.1.0

func (a App) ReadFrom(ctx context.Context, pathname string) (io.ReadSeekCloser, error)

ReadFrom reads content from given pathname

func (App) Remove

func (a App) Remove(ctx context.Context, pathname string) error

Remove file or directory from storage

func (App) Rename

func (a App) Rename(ctx context.Context, oldName, newName string) error

Rename file or directory from storage

func (App) UpdateDate

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

UpdateDate update date from given value

func (App) Walk

func (a App) Walk(ctx context.Context, 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) WriteSizedTo added in v0.5.1

func (a App) WriteSizedTo(ctx context.Context, pathname string, objectSize int64, reader io.Reader) error

WriteSizedTo with content from reader to pathname with known size

func (App) WriteTo added in v0.1.0

func (a App) WriteTo(ctx context.Context, pathname string, reader io.Reader) error

WriteTo with content from reader to pathname

Jump to

Keyboard shortcuts

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