Documentation
¶
Index ¶
- func ReadSpaceAndNodeFromIndexLink(link string) (string, string, error)
- type PermissionCheckFunc
- type Tree
- func (t *Tree) BuildSpaceIDIndexEntry(spaceID string) string
- func (t *Tree) CreateDir(ctx context.Context, n *node.Node) (err error)
- func (tp *Tree) CreateRevision(ctx context.Context, n *node.Node, version string, f *lockedfile.File) (string, error)
- func (t *Tree) Delete(ctx context.Context, n *node.Node) (err error)
- func (t *Tree) DeleteBlob(node *node.Node) error
- func (tp *Tree) DeleteRevision(ctx context.Context, ref *provider.Reference, revisionKey string) error
- func (tp *Tree) DownloadRevision(ctx context.Context, ref *provider.Reference, revisionKey string, ...) (*provider.ResourceInfo, io.ReadCloser, error)
- func (t *Tree) GetMD(ctx context.Context, n *node.Node) (os.FileInfo, error)
- func (t *Tree) InitNewNode(ctx context.Context, n *node.Node, fsize uint64) (metadata.UnlockFunc, error)
- func (t *Tree) ListFolder(ctx context.Context, n *node.Node) ([]*node.Node, error)
- func (tp *Tree) ListRevisions(ctx context.Context, ref *provider.Reference) (revisions []*provider.FileVersion, err error)
- func (t *Tree) Move(ctx context.Context, oldNode *node.Node, newNode *node.Node) (err error)
- func (t *Tree) Propagate(ctx context.Context, n *node.Node, sizeDiff int64) (err error)
- func (t *Tree) PurgeRecycleItemFunc(ctx context.Context, spaceid, key string, path string) (*node.Node, func() error, error)
- func (t *Tree) ReadBlob(node *node.Node) (io.ReadCloser, error)
- func (t *Tree) ResolveSpaceIDIndexEntry(entry string) (string, error)
- func (t *Tree) RestoreRecycleItemFunc(ctx context.Context, spaceid, key, trashPath string, targetNode *node.Node) (*node.Node, *node.Node, func() (*node.Node, error), error)
- func (tp *Tree) RestoreRevision(ctx context.Context, sourceNode, targetNode metadata.MetadataNode, ...) error
- func (t *Tree) Setup() error
- func (t *Tree) TouchFile(ctx context.Context, n *node.Node, markprocessing bool, mtime string) error
- func (t *Tree) WriteBlob(node *node.Node, source string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadSpaceAndNodeFromIndexLink ¶
ReadSpaceAndNodeFromIndexLink reads a symlink and parses space and node id if the link has the correct format, eg: ../../spaces/4c/510ada-c86b-4815-8820-42cdf82c3d51/nodes/4c/51/0a/da/-c86b-4815-8820-42cdf82c3d51 ../../spaces/4c/510ada-c86b-4815-8820-42cdf82c3d51/nodes/4c/51/0a/da/-c86b-4815-8820-42cdf82c3d51.T.2022-02-24T12:35:18.196484592Z
Types ¶
type PermissionCheckFunc ¶
type PermissionCheckFunc func(rp *provider.ResourcePermissions) bool
PermissionCheckFunc defined a function used to check resource permissions
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree manages a hierarchical tree
func New ¶
func New(lu node.PathLookup, bs node.Blobstore, o *options.Options, p permissions.Permissions, cache store.Store, log *zerolog.Logger) *Tree
New returns a new instance of Tree
func (*Tree) BuildSpaceIDIndexEntry ¶
BuildSpaceIDIndexEntry returns the entry for the space id index
func (*Tree) CreateRevision ¶
func (tp *Tree) CreateRevision(ctx context.Context, n *node.Node, version string, f *lockedfile.File) (string, error)
CreateVersion creates a new version of the node
func (*Tree) DeleteBlob ¶
DeleteBlob deletes a blob from the blobstore
func (*Tree) DeleteRevision ¶
func (tp *Tree) DeleteRevision(ctx context.Context, ref *provider.Reference, revisionKey string) error
DeleteRevision deletes the specified revision of the resource
func (*Tree) DownloadRevision ¶
func (tp *Tree) DownloadRevision(ctx context.Context, ref *provider.Reference, revisionKey string, openReaderFunc func(md *provider.ResourceInfo) bool) (*provider.ResourceInfo, io.ReadCloser, error)
DownloadRevision returns a reader for the specified revision FIXME the CS3 api should explicitly allow initiating revision and trash download, a related issue is https://github.com/cs3org/reva/issues/1813
func (*Tree) InitNewNode ¶
func (t *Tree) InitNewNode(ctx context.Context, n *node.Node, fsize uint64) (metadata.UnlockFunc, error)
InitNewNode initializes a new node
func (*Tree) ListFolder ¶
ListFolder lists the content of a folder node
func (*Tree) ListRevisions ¶
func (*Tree) PurgeRecycleItemFunc ¶
func (t *Tree) PurgeRecycleItemFunc(ctx context.Context, spaceid, key string, path string) (*node.Node, func() error, error)
PurgeRecycleItemFunc returns a node and a function to purge it from the trash
func (*Tree) ResolveSpaceIDIndexEntry ¶
ResolveSpaceIDIndexEntry returns the node id for the space id index entry
func (*Tree) RestoreRecycleItemFunc ¶
func (t *Tree) RestoreRecycleItemFunc(ctx context.Context, spaceid, key, trashPath string, targetNode *node.Node) (*node.Node, *node.Node, func() (*node.Node, error), error)
RestoreRecycleItemFunc returns a node and a function to restore it from the trash.