Documentation ¶
Overview ¶
Package index provides ready-to-use tables and DAOs for storing hierarchical data using the nested sets pattern
Index ¶
- func RegisterIndexLen(len int)
- type BatchSend
- type BatchSender
- type CacheDAO
- type Cacher
- type DAO
- type Factory
- type FolderSizeCacheSQL
- func (dao *FolderSizeCacheSQL) DelNode(ctx context.Context, node tree.ITreeNode) error
- func (dao *FolderSizeCacheSQL) GetNodeByMPath(ctx context.Context, path *tree.MPath) (tree.ITreeNode, error)
- func (dao *FolderSizeCacheSQL) GetNodeByUUID(ctx context.Context, uuid string) (tree.ITreeNode, error)
- func (dao *FolderSizeCacheSQL) GetNodeChildren(ctx context.Context, path *tree.MPath, filter ...*tree.MetaFilter) chan interface{}
- func (dao *FolderSizeCacheSQL) GetNodeTree(ctx context.Context, path *tree.MPath, filter ...*tree.MetaFilter) chan interface{}
- func (dao *FolderSizeCacheSQL) GetOrCreateNodeByPath(ctx context.Context, nodePath string, info *tree.Node, rootInfo ...*tree.Node) (tree.ITreeNode, []tree.ITreeNode, error)
- func (dao *FolderSizeCacheSQL) MoveNodeTree(ctx context.Context, nodeFrom tree.ITreeNode, nodeTo tree.ITreeNode) error
- func (dao *FolderSizeCacheSQL) UpdateNode(ctx context.Context, node tree.ITreeNode) error
- type LostAndFound
- type RootGroupProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterIndexLen ¶
func RegisterIndexLen(len int)
Types ¶
type BatchSend ¶
type BatchSend struct {
// contains filtered or unexported fields
}
BatchSend sql structure
type BatchSender ¶
type BatchSender interface { Send(interface{}) Close() error }
BatchSender interface
type DAO ¶
type DAO interface { Migrate(ctx context.Context) error // GetNodeTree retrieves all children recursively GetNodeTree(context.Context, *tree.MPath, ...*tree.MetaFilter) chan interface{} // GetNodeChildren retrieves all direct children of a Collection GetNodeChildren(context.Context, *tree.MPath, ...*tree.MetaFilter) chan interface{} // GetNodeChildrenCounts counts all collection children GetNodeChildrenCounts(context.Context, *tree.MPath, bool) (int, int) // GetNodeChildrenSize sums up all collection children sizes GetNodeChildrenSize(context.Context, *tree.MPath) (int, error) // GetNodesByMPaths takes multiple MPath as input and load all nodes at once GetNodesByMPaths(context.Context, ...*tree.MPath) chan tree.ITreeNode // GetNodeByMPath finds an existing node by its MPath GetNodeByMPath(context.Context, *tree.MPath) (tree.ITreeNode, error) // GetNodeByUUID finds an existing node by its UUID GetNodeByUUID(context.Context, string) (tree.ITreeNode, error) // GetNodeByPath lookups for a node at a given path, returning error if it does not exist GetNodeByPath(ctx context.Context, nodePath string) (tree.ITreeNode, error) // GetOrCreateNodeByPath lookups for an existing node at a given path, and creates it if required. It also creates intermediary collections if necessary. GetOrCreateNodeByPath(ctx context.Context, nodePath string, info *tree.Node, rootInfo ...*tree.Node) (tree.ITreeNode, []tree.ITreeNode, error) // UpdateNode updates a node position (mPath) and metadata UpdateNode(context.Context, tree.ITreeNode) error // DelNode removes a node from the tree DelNode(context.Context, tree.ITreeNode) error // MoveNodeTree moves a whole tree from one position to another. The target must not exist. MoveNodeTree(ctx context.Context, nodeFrom tree.ITreeNode, nodeTo tree.ITreeNode) error // AddNodeStream Simple Add / Set / Delete AddNodeStream(context.Context, int) (chan tree.ITreeNode, chan error) // Flush triggers underlying flush Flush(context.Context, bool) error // SetNodes returns a batcher that can be used for quick updates SetNodes(context.Context, string, int64) BatchSender CleanResourcesOnDeletion(context.Context) (string, error) LostAndFounds(context.Context) ([]LostAndFound, error) FixLostAndFound(ctx context.Context, lost LostAndFound) error Flatten(context.Context) (string, error) UpdateNameInPlace(ctx context.Context, oldName, newName string, knownUuid string, knownLevel int) (int64, error) // contains filtered or unexported methods }
DAO interface
func NewDAOWithCache ¶
NewDAOWithCache for the common sql index
func NewFolderSizeCacheDAO ¶
NewFolderSizeCacheDAO provides a middleware implementation of the index sql dao that removes duplicate entries of the .pydio file that have the same etag at the same level
type Factory ¶
type Factory[T tree.ITreeNode] interface { Struct() T Slice() []T RootGroupProvider }
type FolderSizeCacheSQL ¶
type FolderSizeCacheSQL struct {
DAO
}
FolderSizeCacheSQL implementation
func (*FolderSizeCacheSQL) GetNodeByMPath ¶
func (dao *FolderSizeCacheSQL) GetNodeByMPath(ctx context.Context, path *tree.MPath) (tree.ITreeNode, error)
GetNode from path
func (*FolderSizeCacheSQL) GetNodeByUUID ¶
func (dao *FolderSizeCacheSQL) GetNodeByUUID(ctx context.Context, uuid string) (tree.ITreeNode, error)
GetNodeByUUID returns the node stored with the unique uuid
func (*FolderSizeCacheSQL) GetNodeChildren ¶
func (dao *FolderSizeCacheSQL) GetNodeChildren(ctx context.Context, path *tree.MPath, filter ...*tree.MetaFilter) chan interface{}
GetNodeChildren List
func (*FolderSizeCacheSQL) GetNodeTree ¶
func (dao *FolderSizeCacheSQL) GetNodeTree(ctx context.Context, path *tree.MPath, filter ...*tree.MetaFilter) chan interface{}
GetNodeTree List from the path
func (*FolderSizeCacheSQL) GetOrCreateNodeByPath ¶
func (*FolderSizeCacheSQL) MoveNodeTree ¶
func (dao *FolderSizeCacheSQL) MoveNodeTree(ctx context.Context, nodeFrom tree.ITreeNode, nodeTo tree.ITreeNode) error
MoveNodeTree move all the nodes belonging to a tree by calculating the new mpathes
func (*FolderSizeCacheSQL) UpdateNode ¶
SetNode updates a node, including its tree position
type LostAndFound ¶
type RootGroupProvider ¶
type RootGroupProvider interface {
RootGroup() string
}