storage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRootWithParentDirectory is returned when a root directory has a parent directory.
	ErrRootWithParentDirectory = errors.New("root directory cannot have parent directory")

	// ErrNoRowsAffected is returned when no rows are affected by an operation.
	ErrNoRowsAffected = errors.New("no rows affected")

	// ErrDirectoryWithoutParent is returned when a directory does not have a parent directory.
	ErrDirectoryWithoutParent = errors.New("directory must have a parent directory")

	// ErrDirectoryNotFound is returned when a directory is not found.
	ErrDirectoryNotFound = errors.New("directory not found")

	// ErrReadOnly is returned when a write operation is attempted on a read-only driver.
	ErrReadOnly = errors.New("attempted write operation on read-only driver")

	// ErrNoRootAccess is returned when a root directory is attempted to be accessed
	// without root access.
	ErrNoRootAccess = errors.New("attempted to access root directory without root access")
)

Functions

This section is empty.

Types

type DirectoryAdmin

type DirectoryAdmin interface {
	RootReader
	RootWriter
}

DirectoryAdmin is the interface that allows doing all operations on the directory tree.

type Reader

type Reader interface {
	GetDirectory(ctx context.Context, id v1.DirectoryID) (*v1.Directory, error)
	GetParents(ctx context.Context, id v1.DirectoryID) ([]v1.DirectoryID, error)
	GetParentsUntilAncestor(ctx context.Context, child, ancestor v1.DirectoryID) ([]v1.DirectoryID, error)
	GetChildren(ctx context.Context, id v1.DirectoryID) ([]v1.DirectoryID, error)
}

Reader is the interface that allows doing basic read operations on the directory tree.

type RootReader

type RootReader interface {
	Reader
	ListRoots(ctx context.Context) ([]v1.DirectoryID, error)
}

RootReader is the interface that allows doing all read operations on the directory tree.

type RootWriter

type RootWriter interface {
	Writer
	CreateRoot(ctx context.Context, d *v1.Directory) (*v1.Directory, error)
}

RootWriter is the interface that allows doing all write operations.

type Writer

type Writer interface {
	CreateDirectory(ctx context.Context, d *v1.Directory) (*v1.Directory, error)
}

Writer is the interface that allows doing basic write operations.

Directories

Path Synopsis
crdb
migrations
Package db provides an embedded filesystem containing all the database migrations
Package db provides an embedded filesystem containing all the database migrations

Jump to

Keyboard shortcuts

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