repository

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileAlreadyExists = errors.New("file already exists")
	ErrFileNotFound      = errors.New("file not found")
)

Functions

This section is empty.

Types

type File

type File interface {
	Save(ctx context.Context, id string, reader io.Reader) error
	Read(ctx context.Context, id string, writer io.Writer) error
	Delete(ctx context.Context, id string) error
}

type FileNode

type FileNode interface {
	// GetByPath reads the file node at the given path.
	// It may return ErrFileNotFound.
	GetByPath(ctx context.Context, path string) (model.FileNode, error)

	// GetById reads the file node with the given ID.
	// It may return ErrFileNotFound.
	GetById(ctx context.Context, id model.ID) (model.FileNode, error)

	// Create creates the given file.
	// It may return ErrFileAlreadyExists.
	Create(ctx context.Context, newFileNode model.CreateFileNode) (model.FileNode, error)

	// DeleteById deletes the node with the given ID.
	// It may return ErrFileNotFound.
	DeleteById(ctx context.Context, id model.ID) error

	// SetState changes the state of the node with the given ID.
	// It may return ErrFileNotFound.
	SetState(ctx context.Context, id model.ID, newState model.NodeState) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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