Documentation ¶
Index ¶
- func Pathify(id string, depth, width int) string
- type Lookup
- func (lu *Lookup) InternalPath(spaceID, nodeID string) string
- func (lu *Lookup) InternalRoot() string
- func (lu *Lookup) NodeFromID(ctx context.Context, id *provider.ResourceId) (n *node.Node, err error)
- func (lu *Lookup) NodeFromResource(ctx context.Context, ref *provider.Reference) (*node.Node, error)
- func (lu *Lookup) NodeFromSpaceID(ctx context.Context, id *provider.ResourceId) (n *node.Node, err error)
- func (lu *Lookup) Path(ctx context.Context, n *node.Node) (p string, err error)
- func (lu *Lookup) ShareFolder() string
- func (lu *Lookup) WalkPath(ctx context.Context, r *node.Node, p string, followReferences bool, ...) (*node.Node, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lookup ¶
Lookup implements transformations from filepath to node and back
func (*Lookup) InternalPath ¶
InternalPath returns the internal path for a given ID
func (*Lookup) InternalRoot ¶
InternalRoot returns the internal storage root directory
func (*Lookup) NodeFromID ¶
func (lu *Lookup) NodeFromID(ctx context.Context, id *provider.ResourceId) (n *node.Node, err error)
NodeFromID returns the internal path for the id
func (*Lookup) NodeFromResource ¶
func (lu *Lookup) NodeFromResource(ctx context.Context, ref *provider.Reference) (*node.Node, error)
NodeFromResource takes in a request path or request id and converts it to a Node
func (*Lookup) NodeFromSpaceID ¶
func (lu *Lookup) NodeFromSpaceID(ctx context.Context, id *provider.ResourceId) (n *node.Node, err error)
NodeFromSpaceID converts a resource id without an opaque id into a Node
func (*Lookup) ShareFolder ¶
ShareFolder returns the internal storage root directory
func (*Lookup) WalkPath ¶
func (lu *Lookup) WalkPath(ctx context.Context, r *node.Node, p string, followReferences bool, f func(ctx context.Context, n *node.Node) error) (*node.Node, error)
WalkPath calls n.Child(segment) on every path segment in p starting at the node r. If a function f is given it will be executed for every segment node, but not the root node r. If followReferences is given the current visited reference node is replaced by the referenced node.