filesystem

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileIsNotInDeleteState = errors.New("file is not in delete state")
)
View Source
var (
	ErrFilesystemNil = errors.New("the given filesystem is nil")
)
View Source
var (
	ErrNameNotAllowed = errors.New("the name is not allowed")
)

Functions

func New added in v0.1.5

func New(filesystem afero.Fs) (NodeProvider, FileProvider, error)

Types

type FileProvider added in v0.1.5

type FileProvider struct {
	FS afero.Fs
}

func (FileProvider) Delete added in v0.1.5

func (p FileProvider) Delete(_ context.Context, id string) error

func (FileProvider) Read added in v0.1.5

func (p FileProvider) Read(_ context.Context, id model.ID, writer io.Writer) error

func (FileProvider) Save added in v0.1.5

func (p FileProvider) Save(_ context.Context, id model.ID, reader io.Reader) error

type NodeProvider added in v0.1.5

type NodeProvider struct {
	FS afero.Fs
}

func (NodeProvider) Create added in v0.1.5

func (p NodeProvider) Create(ctx context.Context, newFileNode model.CreateFileNode) (model.FileNode, error)

func (NodeProvider) DeleteById added in v0.1.5

func (p NodeProvider) DeleteById(_ context.Context, id model.ID) error

func (NodeProvider) GetById added in v0.1.5

func (p NodeProvider) GetById(_ context.Context, id model.ID) (model.FileNode, error)

func (NodeProvider) GetByPath added in v0.1.5

func (p NodeProvider) GetByPath(_ context.Context, path string) (model.FileNode, error)

func (NodeProvider) SetState added in v0.1.5

func (p NodeProvider) SetState(ctx context.Context, id model.ID, newState model.NodeState) error

Jump to

Keyboard shortcuts

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