Documentation ¶
Overview ¶
Package index provides ready-to-use tables and DAOs for storing hierarchical data using the nested sets pattern
- Copyright (c) 2018. Abstrium SAS <team (at) pydio.com>
- This file is part of Pydio Cells. *
- Pydio Cells is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio Cells is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio Cells. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com>.
Index ¶
- func NewDAO(o dao.DAO, rootNodeId string) dao.DAO
- func NewNode(treeNode *tree.Node, path mtree.MPath, filenames []string) *mtree.TreeNode
- type BatchSend
- type DAO
- type DAOWrapper
- type IndexSQL
- func (dao *IndexSQL) AddNode(node *mtree.TreeNode) error
- func (dao *IndexSQL) AddNodeStream(max int) (chan *mtree.TreeNode, chan error)
- func (dao *IndexSQL) CleanResourcesOnDeletion() (error, string)
- func (dao *IndexSQL) DelNode(node *mtree.TreeNode) error
- func (dao *IndexSQL) DeleteCommits(node *mtree.TreeNode) error
- func (dao *IndexSQL) Flush(final bool) error
- func (dao *IndexSQL) GetNode(path mtree.MPath) (*mtree.TreeNode, error)
- func (dao *IndexSQL) GetNodeByUUID(uuid string) (*mtree.TreeNode, error)
- func (dao *IndexSQL) GetNodeChild(reqPath mtree.MPath, reqName string) (*mtree.TreeNode, error)
- func (dao *IndexSQL) GetNodeChildren(path mtree.MPath) chan *mtree.TreeNode
- func (dao *IndexSQL) GetNodeChildrenCounts(path mtree.MPath) (int, int)
- func (dao *IndexSQL) GetNodeFirstAvailableChildIndex(reqPath mtree.MPath) (uint64, error)
- func (dao *IndexSQL) GetNodeLastChild(reqPath mtree.MPath) (*mtree.TreeNode, error)
- func (dao *IndexSQL) GetNodeTree(path mtree.MPath, skipFolderSize bool) chan *mtree.TreeNode
- func (dao *IndexSQL) GetNodes(mpathes ...mtree.MPath) chan *mtree.TreeNode
- func (dao *IndexSQL) Init(options common.ConfigValues) error
- func (dao *IndexSQL) ListCommits(node *mtree.TreeNode) (commits []*tree.ChangeLog, err error)
- func (dao *IndexSQL) MoveNodeTree(nodeFrom *mtree.TreeNode, nodeTo *mtree.TreeNode) (e error)
- func (dao *IndexSQL) Path(strpath string, create bool, reqNode ...*tree.Node) (mtree.MPath, []*mtree.TreeNode, error)
- func (dao *IndexSQL) PushCommit(node *mtree.TreeNode) error
- func (dao *IndexSQL) ResyncDirtyEtags(rootNode *mtree.TreeNode) error
- func (dao *IndexSQL) SetNode(node *mtree.TreeNode) error
- func (dao *IndexSQL) SetNodeMeta(node *mtree.TreeNode) error
- func (dao *IndexSQL) SetNodes(etag string, deltaSize int64) sql.BatchSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchSend ¶
type BatchSend struct {
// contains filtered or unexported fields
}
BatchSend sql structure
type DAO ¶
type DAO interface { Path(strpath string, create bool, reqNode ...*tree.Node) (mtree.MPath, []*mtree.TreeNode, error) // Add a node in the tree AddNode(*mtree.TreeNode) error // SetNode updates a node, including its tree position SetNode(*mtree.TreeNode) error // Update a node metadata, without touching its tree position SetNodeMeta(*mtree.TreeNode) error // Remove a node from the tree DelNode(*mtree.TreeNode) error // Simple Add / Set / Delete AddNodeStream(int) (chan *mtree.TreeNode, chan error) Flush(bool) error // Batch Add / Set / Delete GetNodes(...mtree.MPath) chan *mtree.TreeNode SetNodes(string, int64) sql.BatchSender // Getters GetNode(mtree.MPath) (*mtree.TreeNode, error) GetNodeByUUID(string) (*mtree.TreeNode, error) GetNodeChild(mtree.MPath, string) (*mtree.TreeNode, error) GetNodeLastChild(mtree.MPath) (*mtree.TreeNode, error) GetNodeFirstAvailableChildIndex(mtree.MPath) (uint64, error) GetNodeChildrenCounts(mtree.MPath) (int, int) GetNodeChildren(mtree.MPath) chan *mtree.TreeNode GetNodeTree(mtree.MPath, bool) chan *mtree.TreeNode MoveNodeTree(nodeFrom *mtree.TreeNode, nodeTo *mtree.TreeNode) error PushCommit(node *mtree.TreeNode) error DeleteCommits(node *mtree.TreeNode) error ListCommits(node *mtree.TreeNode) ([]*tree.ChangeLog, error) CleanResourcesOnDeletion() (error, string) }
DAO interface
func GetDAOCache ¶
GetDAOCache returns the cache based on the session name
func NewDAOCache ¶
NewDAOCache wraps a cache around the dao
type DAOWrapper ¶
type IndexSQL ¶
IndexSQL implementation
func (*IndexSQL) AddNodeStream ¶
AddNodeStream creates a channel to write to the SQL database
func (*IndexSQL) CleanResourcesOnDeletion ¶
CleanResourcesOnDeletion revert the creation of the table for a datasource
func (*IndexSQL) DeleteCommits ¶
DeleteCommits removes the commit versions of the node
func (*IndexSQL) GetNodeByUUID ¶
GetNodeByUUID returns the node stored with the unique uuid
func (*IndexSQL) GetNodeChild ¶
GetNodeChild from node path whose name matches
func (*IndexSQL) GetNodeChildren ¶
GetNodeChildren List
func (*IndexSQL) GetNodeChildrenCounts ¶ added in v1.5.0
GetNodeChildrenCounts List
func (*IndexSQL) GetNodeFirstAvailableChildIndex ¶
GetNodeFirstAvailableChildIndex from path
func (*IndexSQL) GetNodeLastChild ¶
GetNodeLastChild from path
func (*IndexSQL) GetNodeTree ¶
GetNodeTree List from the path
func (*IndexSQL) Init ¶
func (dao *IndexSQL) Init(options common.ConfigValues) error
Init handles the db version migration and prepare the statements
func (*IndexSQL) ListCommits ¶
ListCommits returns a list of all commit versions for a node
func (*IndexSQL) MoveNodeTree ¶
MoveNodeTree move all the nodes belonging to a tree by calculating the new mpathes
func (*IndexSQL) PushCommit ¶
PushCommit adds a commit version to the node
func (*IndexSQL) ResyncDirtyEtags ¶
ResyncDirtyEtags ensures that etags are rightly calculated
func (*IndexSQL) SetNodeMeta ¶
SetNode in replacement of previous node