Documentation ¶
Index ¶
- Variables
- func NewError[T error](message string, args ...any) T
- func NodeCompare(ctx context.Context, a, b NodeInterface) bool
- func NodeCopy(ctx context.Context, origin, destination NodeInterface, destinationID NodeID, ...)
- func NodeMirror(ctx context.Context, origin, destination NodeInterface, options *MirrorOptions)
- func NodeParallelApply(ctx context.Context, origin NodeInterface, path Path, ...) bool
- func NodeUnify(ctx context.Context, origin NodeInterface, originPath Path, ...)
- func NodeUnifyPath(ctx context.Context, origin NodeInterface, ...)
- func PathAbsoluteString(current, destination string) string
- func PathRelativeString(current, destination string) string
- func RegisterFactory(name string, factory TreeFactory)
- func RemapReferences(ctx context.Context, node NodeInterface, f f3.Interface)
- func SetMappedID(ctx context.Context, origin, destination NodeInterface, options *UnifyOptions)
- func TreeCompare(ctx context.Context, aTree TreeInterface, aPath Path, bTree TreeInterface, ...) bool
- func TreeMirror(ctx context.Context, originTree, destinationTree TreeInterface, path Path, ...)
- func TreeParallelApply(ctx context.Context, origin TreeInterface, path Path, ...) bool
- func TreePartialMirror(ctx context.Context, originTree TreeInterface, originPath Path, ...)
- func TreeUnify(ctx context.Context, origin, destination TreeInterface, options *UnifyOptions)
- func TreeUnifyPath(ctx context.Context, origin TreeInterface, path Path, ...)
- type ApplyFunc
- type ApplyOptions
- type ApplySearch
- type ApplyWhere
- type ChildrenSlice
- type ErrorNodeNotFound
- type ErrorRemapReferencesRelative
- type FactoryFun
- type Kind
- type MapIDInterface
- type MirrorOptions
- type Node
- func (o *Node) Apply(ctx context.Context, parentPath, path Path, options *ApplyOptions) bool
- func (o *Node) ApplyAndGet(ctx context.Context, path Path, options *ApplyOptions) bool
- func (o *Node) CreateChild(ctx context.Context) NodeInterface
- func (o *Node) Delete(ctx context.Context) NodeInterface
- func (o *Node) DeleteChild(id NodeID) NodeInterface
- func (o *Node) Equals(ctx context.Context, other NodeInterface) bool
- func (o *Node) Find(path Path) NodeInterface
- func (o *Node) FindAndGet(ctx context.Context, path Path) NodeInterface
- func (o *Node) FromFormat(f f3.Interface) NodeInterface
- func (o *Node) Get(ctx context.Context) NodeInterface
- func (o *Node) GetChild(id NodeID) NodeInterface
- func (o *Node) GetChildren() ChildrenSlice
- func (o *Node) GetCurrentPath() Path
- func (o *Node) GetDriver() NodeDriverInterface
- func (o *Node) GetID() NodeID
- func (o *Node) GetIDFromName(ctx context.Context, name string) NodeID
- func (o *Node) GetIsNil() bool
- func (o *Node) GetIsSync() bool
- func (o *Node) GetKind() Kind
- func (o *Node) GetMappedID() NodeID
- func (o *Node) GetNodeChildren() NodeChildren
- func (o *Node) GetParent() NodeInterface
- func (o *Node) GetSelf() NodeInterface
- func (o *Node) GetTree() TreeInterface
- func (o *Node) Init(self NodeInterface) NodeInterface
- func (o *Node) List(ctx context.Context) ChildrenSlice
- func (o *Node) ListPage(ctx context.Context, page int) ChildrenSlice
- func (o *Node) LookupMappedID(id NodeID) NodeID
- func (o *Node) MustFind(path Path) NodeInterface
- func (o *Node) NewFormat() f3.Interface
- func (o *Node) SetChild(child NodeInterface) NodeInterface
- func (o *Node) SetChildren(children NodeChildren)
- func (o *Node) SetDriver(driver NodeDriverInterface)
- func (o *Node) SetID(id NodeID)
- func (o *Node) SetIsNil(isNil bool)
- func (o *Node) SetIsSync(sync bool)
- func (o *Node) SetKind(kind Kind)
- func (o *Node) SetMappedID(mapped NodeID)
- func (o *Node) SetParent(parent NodeInterface)
- func (o *Node) SetSelf(self NodeInterface)
- func (o *Node) SetTree(tree TreeInterface)
- func (o *Node) String() string
- func (o *Node) ToFormat() f3.Interface
- func (o *Node) Upsert(ctx context.Context) NodeInterface
- func (o *Node) Walk(ctx context.Context, parent Path, options *WalkOptions)
- func (o *Node) WalkAndGet(ctx context.Context, parent Path, options *WalkOptions)
- type NodeAccessorsInterface
- type NodeChildren
- type NodeDriverInterface
- type NodeDriverProxyInterface
- type NodeID
- type NodeInterface
- type NodeTreeInterface
- type NullDriver
- func (o *NullDriver) Delete(context.Context)
- func (o *NullDriver) Equals(context.Context, NodeInterface) bool
- func (o *NullDriver) FromFormat(f3.Interface)
- func (o *NullDriver) Get(context.Context) bool
- func (o *NullDriver) GetIDFromName(ctx context.Context, name string) NodeID
- func (o *NullDriver) GetMappedID() NodeID
- func (o *NullDriver) GetNode() NodeInterface
- func (o *NullDriver) GetTreeDriver() TreeDriverInterface
- func (o *NullDriver) IsNull() bool
- func (o *NullDriver) ListPage(context.Context, int) ChildrenSlice
- func (o *NullDriver) LookupMappedID(NodeID) NodeID
- func (o *NullDriver) NewFormat() f3.Interface
- func (o *NullDriver) Patch(context.Context)
- func (o *NullDriver) Put(context.Context) NodeID
- func (o *NullDriver) SetMappedID(mapped NodeID)
- func (o *NullDriver) SetNode(node NodeInterface)
- func (o *NullDriver) SetTreeDriver(treeDriver TreeDriverInterface)
- func (o *NullDriver) String() string
- func (o *NullDriver) ToFormat() f3.Interface
- type NullTreeDriver
- func (o *NullTreeDriver) AllocateID() bool
- func (o *NullTreeDriver) Diff(a, b NodeDriverInterface) string
- func (o *NullTreeDriver) Factory(ctx context.Context, kind Kind) NodeDriverInterface
- func (o *NullTreeDriver) GetPageSize() int
- func (o *NullTreeDriver) GetTree() TreeInterface
- func (o *NullTreeDriver) Init()
- func (o *NullTreeDriver) SetPageSize(pageSize int)
- func (o *NullTreeDriver) SetTree(tree TreeInterface)
- type ParallelApplyFunc
- type ParallelApplyOptions
- type Path
- func NewPath(nodes ...NodeInterface) Path
- func NewPathFromString(pathString string) Path
- func NodeCollectReferences(ctx context.Context, node NodeInterface) []Path
- func PathAbsolute(current, destination string) Path
- func TreeCollectReferences(ctx context.Context, tree TreeInterface, path Path) []Path
- func TreePathRemap(ctx context.Context, origin TreeInterface, path Path, ...) Path
- type PathImplementation
- func (o PathImplementation) All() []NodeInterface
- func (o PathImplementation) Append(child NodeInterface) Path
- func (o PathImplementation) Empty() bool
- func (o PathImplementation) First() NodeInterface
- func (o PathImplementation) Last() NodeInterface
- func (o PathImplementation) Length() int
- func (o PathImplementation) PathMappedString() PathString
- func (o PathImplementation) PathString() PathString
- func (o PathImplementation) Pop() (NodeInterface, Path)
- func (o PathImplementation) PopFirst() (NodeInterface, Path)
- func (o PathImplementation) RemoveFirst() Path
- func (o PathImplementation) RemoveLast() Path
- func (o PathImplementation) String() string
- type PathString
- type Tree
- func (o *Tree) AllocateID() bool
- func (o *Tree) Apply(ctx context.Context, path Path, options *ApplyOptions) bool
- func (o *Tree) ApplyAndGet(ctx context.Context, path Path, options *ApplyOptions) bool
- func (o *Tree) Clear(ctx context.Context)
- func (o *Tree) Diff(a, b NodeInterface) string
- func (o *Tree) Exists(ctx context.Context, path Path) bool
- func (o *Tree) Factory(ctx context.Context, kind Kind) NodeInterface
- func (o *Tree) Find(path Path) NodeInterface
- func (o *Tree) FindAndGet(ctx context.Context, path Path) NodeInterface
- func (o *Tree) GetChildrenKind(parentKind Kind) Kind
- func (o *Tree) GetDriver() TreeDriverInterface
- func (o *Tree) GetOptions() options.Interface
- func (o *Tree) GetPageSize() int
- func (o *Tree) GetRoot() NodeInterface
- func (o *Tree) GetSelf() TreeInterface
- func (o *Tree) Init(self TreeInterface, opts options.Interface) TreeInterface
- func (o *Tree) MustFind(path Path) NodeInterface
- func (o *Tree) Register(kind Kind, factory FactoryFun)
- func (o *Tree) SetDriver(driver TreeDriverInterface)
- func (o *Tree) SetOptions(opts options.Interface)
- func (o *Tree) SetRoot(root NodeInterface)
- func (o *Tree) SetSelf(self TreeInterface)
- func (o *Tree) Walk(ctx context.Context, options *WalkOptions)
- func (o *Tree) WalkAndGet(ctx context.Context, options *WalkOptions)
- type TreeDriverInterface
- type TreeFactory
- type TreeInterface
- type UnifyDeleteFunc
- type UnifyOptions
- type UnifyUpsertFunc
- type WalkFunc
- type WalkOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( KindNil = Kind("") KindRoot = Kind("<root>") )
View Source
var ( NilNode = &Node{isNil: true} NilParent = NilNode )
View Source
var DefaultPageSize = int(25)
View Source
var NilID = NewNodeID("")
Functions ¶
func NodeCompare ¶
func NodeCompare(ctx context.Context, a, b NodeInterface) bool
func NodeCopy ¶
func NodeCopy(ctx context.Context, origin, destination NodeInterface, destinationID NodeID, options *UnifyOptions)
func NodeMirror ¶
func NodeMirror(ctx context.Context, origin, destination NodeInterface, options *MirrorOptions)
func NodeParallelApply ¶
func NodeParallelApply(ctx context.Context, origin NodeInterface, path Path, destination NodeInterface, options *ParallelApplyOptions) bool
func NodeUnify ¶
func NodeUnify(ctx context.Context, origin NodeInterface, originPath Path, destination NodeInterface, destinationPath Path, options *UnifyOptions)
func NodeUnifyPath ¶
func NodeUnifyPath(ctx context.Context, origin NodeInterface, originPath, path, destinationPath Path, options *UnifyOptions)
func PathAbsoluteString ¶
func PathRelativeString ¶ added in v3.2.0
func RegisterFactory ¶
func RegisterFactory(name string, factory TreeFactory)
func RemapReferences ¶
func RemapReferences(ctx context.Context, node NodeInterface, f f3.Interface)
func SetMappedID ¶
func SetMappedID(ctx context.Context, origin, destination NodeInterface, options *UnifyOptions)
func TreeCompare ¶
func TreeCompare(ctx context.Context, aTree TreeInterface, aPath Path, bTree TreeInterface, bPath Path) bool
func TreeMirror ¶
func TreeMirror(ctx context.Context, originTree, destinationTree TreeInterface, path Path, options *MirrorOptions)
func TreeParallelApply ¶
func TreeParallelApply(ctx context.Context, origin TreeInterface, path Path, destination TreeInterface, options *ParallelApplyOptions) bool
func TreePartialMirror ¶
func TreePartialMirror(ctx context.Context, originTree TreeInterface, originPath Path, destinationTree TreeInterface, destinationPath Path, options *MirrorOptions)
func TreeUnify ¶
func TreeUnify(ctx context.Context, origin, destination TreeInterface, options *UnifyOptions)
func TreeUnifyPath ¶
func TreeUnifyPath(ctx context.Context, origin TreeInterface, path Path, destination TreeInterface, options *UnifyOptions)
Types ¶
type ApplyFunc ¶
type ApplyFunc func(ctx context.Context, parentPath, path Path, node NodeInterface)
type ApplyOptions ¶
type ApplyOptions struct {
// contains filtered or unexported fields
}
func NewApplyOptions ¶
func NewApplyOptions(fun ApplyFunc) *ApplyOptions
func (*ApplyOptions) SetSearch ¶
func (o *ApplyOptions) SetSearch(search ApplySearch) *ApplyOptions
func (*ApplyOptions) SetWhere ¶
func (o *ApplyOptions) SetWhere(where ApplyWhere) *ApplyOptions
type ApplySearch ¶
type ApplySearch bool
const ( ApplySearchByName ApplySearch = true ApplySearchByID ApplySearch = false )
type ApplyWhere ¶
type ApplyWhere bool
const ( ApplyEachNode ApplyWhere = true ApplyLastNode ApplyWhere = false )
type ChildrenSlice ¶
type ChildrenSlice []NodeInterface
func NewChildrenSlice ¶
func NewChildrenSlice(len int) ChildrenSlice
func (ChildrenSlice) Len ¶
func (o ChildrenSlice) Len() int
func (ChildrenSlice) Less ¶
func (o ChildrenSlice) Less(i, j int) bool
func (ChildrenSlice) Swap ¶
func (o ChildrenSlice) Swap(i, j int)
type ErrorNodeNotFound ¶
type ErrorNodeNotFound error
type ErrorRemapReferencesRelative ¶ added in v3.3.1
type ErrorRemapReferencesRelative error
type FactoryFun ¶
type FactoryFun func(ctx context.Context, kind Kind) NodeInterface
type MapIDInterface ¶
type MirrorOptions ¶
type MirrorOptions struct {
// contains filtered or unexported fields
}
func NewMirrorOptions ¶
func NewMirrorOptions() *MirrorOptions
func (*MirrorOptions) SetNoRemap ¶
func (o *MirrorOptions) SetNoRemap(noremap bool) *MirrorOptions
type Node ¶
func (*Node) ApplyAndGet ¶
func (*Node) CreateChild ¶
func (o *Node) CreateChild(ctx context.Context) NodeInterface
func (*Node) DeleteChild ¶
func (o *Node) DeleteChild(id NodeID) NodeInterface
func (*Node) Find ¶
func (o *Node) Find(path Path) NodeInterface
func (*Node) FindAndGet ¶
func (o *Node) FindAndGet(ctx context.Context, path Path) NodeInterface
func (*Node) FromFormat ¶
func (o *Node) FromFormat(f f3.Interface) NodeInterface
func (*Node) GetChild ¶
func (o *Node) GetChild(id NodeID) NodeInterface
func (*Node) GetChildren ¶
func (o *Node) GetChildren() ChildrenSlice
func (*Node) GetCurrentPath ¶
func (*Node) GetDriver ¶
func (o *Node) GetDriver() NodeDriverInterface
func (*Node) GetMappedID ¶
func (*Node) GetNodeChildren ¶
func (o *Node) GetNodeChildren() NodeChildren
func (*Node) GetParent ¶
func (o *Node) GetParent() NodeInterface
func (*Node) GetSelf ¶
func (o *Node) GetSelf() NodeInterface
func (*Node) GetTree ¶
func (o *Node) GetTree() TreeInterface
func (*Node) Init ¶
func (o *Node) Init(self NodeInterface) NodeInterface
func (*Node) LookupMappedID ¶
func (*Node) MustFind ¶
func (o *Node) MustFind(path Path) NodeInterface
func (*Node) SetChild ¶
func (o *Node) SetChild(child NodeInterface) NodeInterface
func (*Node) SetChildren ¶
func (o *Node) SetChildren(children NodeChildren)
func (*Node) SetDriver ¶
func (o *Node) SetDriver(driver NodeDriverInterface)
func (*Node) SetMappedID ¶
func (*Node) SetParent ¶
func (o *Node) SetParent(parent NodeInterface)
func (*Node) SetSelf ¶
func (o *Node) SetSelf(self NodeInterface)
func (*Node) SetTree ¶
func (o *Node) SetTree(tree TreeInterface)
func (*Node) WalkAndGet ¶
func (o *Node) WalkAndGet(ctx context.Context, parent Path, options *WalkOptions)
type NodeAccessorsInterface ¶
type NodeAccessorsInterface interface { SetIsNil(bool) GetIsNil() bool SetIsSync(bool) GetIsSync() bool GetParent() NodeInterface SetParent(NodeInterface) GetKind() Kind SetKind(Kind) GetID() NodeID SetID(NodeID) GetTree() TreeInterface SetTree(TreeInterface) GetNodeChildren() NodeChildren GetChildren() ChildrenSlice SetChildren(NodeChildren) GetDriver() NodeDriverInterface SetDriver(NodeDriverInterface) }
type NodeChildren ¶
type NodeChildren map[NodeID]NodeInterface
func NewNodeChildren ¶
func NewNodeChildren() NodeChildren
type NodeDriverInterface ¶
type NodeDriverInterface interface { logger.MessageInterface MapIDInterface IsNull() bool GetNode() NodeInterface SetNode(NodeInterface) SetTreeDriver(treeDriver TreeDriverInterface) GetTreeDriver() TreeDriverInterface ListPage(context.Context, int) ChildrenSlice GetIDFromName(context.Context, string) NodeID Equals(context.Context, NodeInterface) bool Get(context.Context) bool Put(context.Context) NodeID Patch(context.Context) Delete(context.Context) NewFormat() f3.Interface FromFormat(f3.Interface) ToFormat() f3.Interface LookupMappedID(NodeID) NodeID String() string }
func NewNullDriver ¶
func NewNullDriver() NodeDriverInterface
type NodeDriverProxyInterface ¶
type NodeDriverProxyInterface interface { MapIDInterface ListPage(context.Context, int) ChildrenSlice GetIDFromName(context.Context, string) NodeID Equals(context.Context, NodeInterface) bool Get(context.Context) NodeInterface Upsert(context.Context) NodeInterface Delete(context.Context) NodeInterface NewFormat() f3.Interface FromFormat(f3.Interface) NodeInterface ToFormat() f3.Interface LookupMappedID(NodeID) NodeID }
type NodeID ¶
func GetMappedID ¶
func GetMappedID(ctx context.Context, origin, destinationParent NodeInterface, options *UnifyOptions) NodeID
type NodeInterface ¶
type NodeInterface interface { logger.MessageInterface NodeAccessorsInterface NodeTreeInterface NodeDriverProxyInterface Init(NodeInterface) NodeInterface GetSelf() NodeInterface SetSelf(NodeInterface) String() string }
func NewNode ¶
func NewNode() NodeInterface
func NewNodeFromID ¶
func NewNodeFromID[T any](id T) NodeInterface
func NodeUnifyOne ¶
func NodeUnifyOne(ctx context.Context, origin NodeInterface, originPath, path, destinationPath Path, options *UnifyOptions) NodeInterface
type NodeTreeInterface ¶
type NodeTreeInterface interface { GetChild(NodeID) NodeInterface GetIDFromName(context.Context, string) NodeID SetChild(NodeInterface) NodeInterface DeleteChild(NodeID) NodeInterface CreateChild(context.Context) NodeInterface MustFind(Path) NodeInterface Find(Path) NodeInterface FindAndGet(context.Context, Path) NodeInterface GetCurrentPath() Path Walk(ctx context.Context, parent Path, options *WalkOptions) WalkAndGet(ctx context.Context, parent Path, options *WalkOptions) Apply(ctx context.Context, parent, path Path, options *ApplyOptions) bool ApplyAndGet(ctx context.Context, path Path, options *ApplyOptions) bool List(context.Context) ChildrenSlice }
type NullDriver ¶
func (*NullDriver) Delete ¶
func (o *NullDriver) Delete(context.Context)
func (*NullDriver) Equals ¶
func (o *NullDriver) Equals(context.Context, NodeInterface) bool
func (*NullDriver) FromFormat ¶
func (o *NullDriver) FromFormat(f3.Interface)
func (*NullDriver) GetIDFromName ¶
func (o *NullDriver) GetIDFromName(ctx context.Context, name string) NodeID
func (*NullDriver) GetMappedID ¶
func (o *NullDriver) GetMappedID() NodeID
func (*NullDriver) GetNode ¶
func (o *NullDriver) GetNode() NodeInterface
func (*NullDriver) GetTreeDriver ¶
func (o *NullDriver) GetTreeDriver() TreeDriverInterface
func (*NullDriver) IsNull ¶
func (o *NullDriver) IsNull() bool
func (*NullDriver) ListPage ¶
func (o *NullDriver) ListPage(context.Context, int) ChildrenSlice
func (*NullDriver) LookupMappedID ¶
func (o *NullDriver) LookupMappedID(NodeID) NodeID
func (*NullDriver) NewFormat ¶
func (o *NullDriver) NewFormat() f3.Interface
func (*NullDriver) Patch ¶
func (o *NullDriver) Patch(context.Context)
func (*NullDriver) SetMappedID ¶
func (o *NullDriver) SetMappedID(mapped NodeID)
func (*NullDriver) SetNode ¶
func (o *NullDriver) SetNode(node NodeInterface)
func (*NullDriver) SetTreeDriver ¶
func (o *NullDriver) SetTreeDriver(treeDriver TreeDriverInterface)
func (*NullDriver) String ¶
func (o *NullDriver) String() string
func (*NullDriver) ToFormat ¶
func (o *NullDriver) ToFormat() f3.Interface
type NullTreeDriver ¶
func (*NullTreeDriver) AllocateID ¶
func (o *NullTreeDriver) AllocateID() bool
func (*NullTreeDriver) Diff ¶
func (o *NullTreeDriver) Diff(a, b NodeDriverInterface) string
func (*NullTreeDriver) Factory ¶
func (o *NullTreeDriver) Factory(ctx context.Context, kind Kind) NodeDriverInterface
func (*NullTreeDriver) GetPageSize ¶
func (o *NullTreeDriver) GetPageSize() int
func (*NullTreeDriver) GetTree ¶
func (o *NullTreeDriver) GetTree() TreeInterface
func (*NullTreeDriver) Init ¶
func (o *NullTreeDriver) Init()
func (*NullTreeDriver) SetPageSize ¶
func (o *NullTreeDriver) SetPageSize(pageSize int)
func (*NullTreeDriver) SetTree ¶
func (o *NullTreeDriver) SetTree(tree TreeInterface)
type ParallelApplyFunc ¶
type ParallelApplyFunc func(ctx context.Context, origin, destination NodeInterface)
type ParallelApplyOptions ¶
type ParallelApplyOptions struct {
// contains filtered or unexported fields
}
func NewParallelApplyOptions ¶
func NewParallelApplyOptions(fun ParallelApplyFunc) *ParallelApplyOptions
func (*ParallelApplyOptions) SetNoRemap ¶
func (o *ParallelApplyOptions) SetNoRemap(noremap bool) *ParallelApplyOptions
func (*ParallelApplyOptions) SetWhere ¶
func (o *ParallelApplyOptions) SetWhere(where ApplyWhere) *ParallelApplyOptions
type Path ¶
type Path interface { Length() int PathString() PathString PathMappedString() PathString String() string Append(child NodeInterface) Path RemoveFirst() Path PopFirst() (NodeInterface, Path) Pop() (NodeInterface, Path) RemoveLast() Path Empty() bool First() NodeInterface Last() NodeInterface All() []NodeInterface }
func NewPath ¶
func NewPath(nodes ...NodeInterface) Path
func NewPathFromString ¶
func NodeCollectReferences ¶
func NodeCollectReferences(ctx context.Context, node NodeInterface) []Path
func PathAbsolute ¶
func TreeCollectReferences ¶
func TreeCollectReferences(ctx context.Context, tree TreeInterface, path Path) []Path
func TreePathRemap ¶
func TreePathRemap(ctx context.Context, origin TreeInterface, path Path, destination TreeInterface) Path
type PathImplementation ¶
type PathImplementation []NodeInterface
func (PathImplementation) All ¶
func (o PathImplementation) All() []NodeInterface
func (PathImplementation) Append ¶
func (o PathImplementation) Append(child NodeInterface) Path
func (PathImplementation) Empty ¶
func (o PathImplementation) Empty() bool
func (PathImplementation) First ¶
func (o PathImplementation) First() NodeInterface
func (PathImplementation) Last ¶
func (o PathImplementation) Last() NodeInterface
func (PathImplementation) Length ¶
func (o PathImplementation) Length() int
func (PathImplementation) PathMappedString ¶
func (o PathImplementation) PathMappedString() PathString
func (PathImplementation) PathString ¶
func (o PathImplementation) PathString() PathString
func (PathImplementation) Pop ¶
func (o PathImplementation) Pop() (NodeInterface, Path)
func (PathImplementation) PopFirst ¶
func (o PathImplementation) PopFirst() (NodeInterface, Path)
func (PathImplementation) RemoveFirst ¶
func (o PathImplementation) RemoveFirst() Path
func (PathImplementation) RemoveLast ¶
func (o PathImplementation) RemoveLast() Path
func (PathImplementation) String ¶
func (o PathImplementation) String() string
type PathString ¶
type PathString []string
func (PathString) Empty ¶
func (o PathString) Empty() bool
func (PathString) Join ¶
func (o PathString) Join() string
type Tree ¶
func (*Tree) AllocateID ¶
func (*Tree) ApplyAndGet ¶
func (*Tree) Diff ¶
func (o *Tree) Diff(a, b NodeInterface) string
func (*Tree) Find ¶
func (o *Tree) Find(path Path) NodeInterface
func (*Tree) FindAndGet ¶
func (o *Tree) FindAndGet(ctx context.Context, path Path) NodeInterface
func (*Tree) GetChildrenKind ¶
func (*Tree) GetDriver ¶
func (o *Tree) GetDriver() TreeDriverInterface
func (*Tree) GetOptions ¶
func (*Tree) GetPageSize ¶
func (*Tree) GetRoot ¶
func (o *Tree) GetRoot() NodeInterface
func (*Tree) GetSelf ¶
func (o *Tree) GetSelf() TreeInterface
func (*Tree) Init ¶
func (o *Tree) Init(self TreeInterface, opts options.Interface) TreeInterface
func (*Tree) MustFind ¶
func (o *Tree) MustFind(path Path) NodeInterface
func (*Tree) Register ¶
func (o *Tree) Register(kind Kind, factory FactoryFun)
func (*Tree) SetDriver ¶
func (o *Tree) SetDriver(driver TreeDriverInterface)
func (*Tree) SetOptions ¶
func (*Tree) SetRoot ¶
func (o *Tree) SetRoot(root NodeInterface)
func (*Tree) SetSelf ¶
func (o *Tree) SetSelf(self TreeInterface)
func (*Tree) WalkAndGet ¶
func (o *Tree) WalkAndGet(ctx context.Context, options *WalkOptions)
type TreeDriverInterface ¶
type TreeDriverInterface interface { logger.Interface GetTree() TreeInterface SetTree(TreeInterface) GetPageSize() int SetPageSize(int) AllocateID() bool Init() Diff(a, b NodeDriverInterface) string Factory(ctx context.Context, kind Kind) NodeDriverInterface }
func NewNullTreeDriver ¶
func NewNullTreeDriver() TreeDriverInterface
type TreeFactory ¶
type TreeFactory func(ctx context.Context, opts options.Interface) TreeInterface
func GetFactory ¶
func GetFactory(name string) TreeFactory
type TreeInterface ¶
type TreeInterface interface { logger.Interface Init(TreeInterface, options.Interface) TreeInterface GetOptions() options.Interface SetOptions(options.Interface) GetSelf() TreeInterface SetSelf(TreeInterface) SetRoot(NodeInterface) GetRoot() NodeInterface SetLogger(logger.Interface) GetLogger() logger.Interface GetDriver() TreeDriverInterface SetDriver(TreeDriverInterface) GetChildrenKind(Kind) Kind GetPageSize() int AllocateID() bool Clear(context.Context) Diff(a, b NodeInterface) string MustFind(Path) NodeInterface Find(Path) NodeInterface FindAndGet(context.Context, Path) NodeInterface Exists(context.Context, Path) bool Walk(context.Context, *WalkOptions) WalkAndGet(context.Context, *WalkOptions) Apply(context.Context, Path, *ApplyOptions) bool ApplyAndGet(context.Context, Path, *ApplyOptions) bool Register(kind Kind, factory FactoryFun) Factory(ctx context.Context, kind Kind) NodeInterface }
func NewTree ¶
func NewTree(opts options.Interface) TreeInterface
type UnifyDeleteFunc ¶
type UnifyDeleteFunc func(ctx context.Context, destination NodeInterface, destinationParent Path)
type UnifyOptions ¶
type UnifyOptions struct {
// contains filtered or unexported fields
}
func NewUnifyOptions ¶
func NewUnifyOptions(destinationTree TreeInterface) *UnifyOptions
func (*UnifyOptions) SetDelete ¶
func (o *UnifyOptions) SetDelete(delete UnifyDeleteFunc) *UnifyOptions
func (*UnifyOptions) SetNoRemap ¶
func (o *UnifyOptions) SetNoRemap(noremap bool) *UnifyOptions
func (*UnifyOptions) SetUpsert ¶
func (o *UnifyOptions) SetUpsert(upsert UnifyUpsertFunc) *UnifyOptions
type UnifyUpsertFunc ¶
type UnifyUpsertFunc func(ctx context.Context, origin NodeInterface, originParent Path, destination NodeInterface, destinationParent Path)
type WalkOptions ¶
type WalkOptions struct {
// contains filtered or unexported fields
}
func NewWalkOptions ¶
func NewWalkOptions(fun WalkFunc) *WalkOptions
Click to show internal directories.
Click to hide internal directories.