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 Option ¶ added in v0.0.13
type Option func(opts *Options)
Option defines a storage Options handler.
type Options ¶ added in v0.0.13
type Options struct { // WithDeletedDirectories includes deleted directories in queries. WithDeletedDirectories bool }
Options contains all possible storage options.
func BuildOptions ¶ added in v0.0.13
BuildOptions applies all options to a new Options instance.
type Reader ¶
type Reader interface { GetDirectory(ctx context.Context, id v1.DirectoryID, options ...Option) (*v1.Directory, error) GetParents(ctx context.Context, id v1.DirectoryID, options ...Option) ([]v1.DirectoryID, error) GetParentsUntilAncestor( ctx context.Context, child, ancestor v1.DirectoryID, options ...Option, ) ([]v1.DirectoryID, error) GetChildren(ctx context.Context, id v1.DirectoryID, options ...Option) ([]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, options ...Option) ([]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) UpdateDirectory(ctx context.Context, d *v1.Directory) error DeleteDirectory(ctx context.Context, id v1.DirectoryID) ([]*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 |
Package memory implements a memory storage backend for the fertilesoil storage interface.
|
Package memory implements a memory storage backend for the fertilesoil storage interface. |
Click to show internal directories.
Click to hide internal directories.