generic

package
v3.11.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SupportListOptionSince = 1 << 1
)

Variables

View Source
var DefaultPageSize = int(25)
View Source
var NilListOptions = &listOptions{}

Functions

func Apply added in v3.11.3

func Apply(ctx context.Context, self NodeInterface, parentPath, p Path, options *ApplyOptions) bool

func ApplyAndGet added in v3.11.3

func ApplyAndGet(ctx context.Context, self NodeInterface, p Path, options *ApplyOptions) bool

func GetMappedID

func GetMappedID(ctx context.Context, origin, destinationParent NodeInterface, options *MirrorOptions) id.NodeID

func NewError

func NewError[T error](message string, args ...any) T

func NodeCompare

func NodeCompare(ctx context.Context, a, b NodeInterface) bool

func NodeCopy

func NodeCopy(ctx context.Context, origin, destination NodeInterface, destinationID id.NodeID, options *MirrorOptions)

func NodeCreateChild added in v3.11.14

func NodeCreateChild(ctx context.Context, tree TreeInterface, parentPath Path, kind kind.Kind, set SetFunc) (Path, NodeInterface)

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 *MirrorOptions)

func PathAbsoluteString

func PathAbsoluteString(current, destination string) string

func PathRelativeString added in v3.2.0

func PathRelativeString(current, destination string) string

func ReadablePathString added in v3.11.5

func ReadablePathString(p Path) []string

func ReadableString added in v3.11.5

func ReadableString(p Path) string

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 *MirrorOptions)

func TreeClear added in v3.11.4

func TreeClear(ctx context.Context, self TreeInterface)

func TreeCompare

func TreeCompare(ctx context.Context, aTree TreeInterface, aPath Path, bTree TreeInterface, bPath Path) bool

func TreeCreateChildFromPath added in v3.11.14

func TreeCreateChildFromPath(ctx context.Context, tree TreeInterface, pathString string, set SetFunc)

func TreeParallelApply

func TreeParallelApply(ctx context.Context, origin TreeInterface, path Path, destination TreeInterface, options *ParallelApplyOptions) bool

func TreeRename added in v3.11.6

func TreeRename(tree TreeInterface, kind kind.Kind, f f3.Interface)

func TreeSetDriver added in v3.11.4

func TreeSetDriver(tree TreeInterface, driver TreeDriverInterface)

func TreeSetRename added in v3.11.6

func TreeSetRename(tree TreeInterface, fromPath, toPath Path)

func TreeUnify

func TreeUnify(ctx context.Context, origin, destination TreeInterface, options *MirrorOptions)

func Walk added in v3.11.3

func Walk(ctx context.Context, self NodeInterface, parent Path, options *WalkOptions)

func WalkAndGet added in v3.11.3

func WalkAndGet(ctx context.Context, self NodeInterface, parent Path, options *WalkOptions)

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) GetListOptions added in v3.11.12

func (o *ApplyOptions) GetListOptions() ListOptions

func (*ApplyOptions) SetListOptions added in v3.11.12

func (o *ApplyOptions) SetListOptions(listOptions ListOptions)

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 ChildrenList added in v3.11.2

type ChildrenList []NodeInterface

func List added in v3.11.3

func ListPage added in v3.11.3

func ListPage(ctx context.Context, self NodeInterface, opts ListOptions, page int) ChildrenList

func NewChildrenList added in v3.11.2

func NewChildrenList(len int) ChildrenList

func (ChildrenList) String added in v3.11.4

func (o ChildrenList) String() string

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.Kind) NodeInterface

type Implementation added in v3.11.14

type Implementation []NodeInterface

func (Implementation) All added in v3.11.14

func (o Implementation) All() []NodeInterface

func (Implementation) Append added in v3.11.14

func (o Implementation) Append(child NodeInterface) Path

func (Implementation) AppendID added in v3.11.14

func (o Implementation) AppendID(id string) Path

func (Implementation) Attachments added in v3.11.14

func (o Implementation) Attachments() Path

func (Implementation) Comments added in v3.11.14

func (o Implementation) Comments() Path

func (Implementation) Empty added in v3.11.14

func (o Implementation) Empty() bool

func (Implementation) First added in v3.11.14

func (o Implementation) First() NodeInterface

func (Implementation) Forge added in v3.11.14

func (o Implementation) Forge() Path

func (Implementation) Get added in v3.11.14

func (o Implementation) Get(i int) NodeInterface

func (Implementation) Ignore added in v3.11.14

func (o Implementation) Ignore() Path

func (Implementation) Issues added in v3.11.14

func (o Implementation) Issues() Path

func (Implementation) Labels added in v3.11.14

func (o Implementation) Labels() Path

func (Implementation) Last added in v3.11.14

func (o Implementation) Last() NodeInterface

func (Implementation) Length added in v3.11.14

func (o Implementation) Length() int

func (Implementation) MappedString added in v3.11.14

func (o Implementation) MappedString() string

func (Implementation) Milestones added in v3.11.14

func (o Implementation) Milestones() Path

func (Implementation) NodeIDs added in v3.11.14

func (o Implementation) NodeIDs() []id.NodeID

func (Implementation) Organizations added in v3.11.14

func (o Implementation) Organizations() Path

func (Implementation) OwnerAndProjectID added in v3.11.14

func (o Implementation) OwnerAndProjectID() (owner, project int64)

func (Implementation) Owners added in v3.11.14

func (o Implementation) Owners() Path

func (Implementation) PathMappedString added in v3.11.14

func (o Implementation) PathMappedString() []string

func (Implementation) PathString added in v3.11.14

func (o Implementation) PathString() []string

func (Implementation) Pop added in v3.11.14

func (o Implementation) Pop() (NodeInterface, Path)

func (Implementation) PopFirst added in v3.11.14

func (o Implementation) PopFirst() (NodeInterface, Path)

func (Implementation) Projects added in v3.11.14

func (o Implementation) Projects() Path

func (Implementation) PullRequests added in v3.11.14

func (o Implementation) PullRequests() Path

func (Implementation) Reactions added in v3.11.14

func (o Implementation) Reactions() Path

func (Implementation) Releases added in v3.11.14

func (o Implementation) Releases() Path

func (Implementation) RemoveFirst added in v3.11.14

func (o Implementation) RemoveFirst() Path

func (Implementation) RemoveLast added in v3.11.14

func (o Implementation) RemoveLast() Path

func (Implementation) Repositories added in v3.11.14

func (o Implementation) Repositories() Path

func (Implementation) ReviewComments added in v3.11.14

func (o Implementation) ReviewComments() Path

func (Implementation) Reviews added in v3.11.14

func (o Implementation) Reviews() Path

func (Implementation) Root added in v3.11.14

func (o Implementation) Root() Path

func (Implementation) SetAttachments added in v3.11.14

func (o Implementation) SetAttachments() Path

func (Implementation) SetComments added in v3.11.14

func (o Implementation) SetComments() Path

func (Implementation) SetForge added in v3.11.14

func (o Implementation) SetForge() Path

func (Implementation) SetIssues added in v3.11.14

func (o Implementation) SetIssues() Path

func (Implementation) SetLabels added in v3.11.14

func (o Implementation) SetLabels() Path

func (Implementation) SetMilestones added in v3.11.14

func (o Implementation) SetMilestones() Path

func (Implementation) SetOrganizations added in v3.11.14

func (o Implementation) SetOrganizations() Path

func (Implementation) SetOwners added in v3.11.14

func (o Implementation) SetOwners(owners kind.Kind) Path

func (Implementation) SetProjects added in v3.11.14

func (o Implementation) SetProjects() Path

func (Implementation) SetPullRequests added in v3.11.14

func (o Implementation) SetPullRequests() Path

func (Implementation) SetReactions added in v3.11.14

func (o Implementation) SetReactions() Path

func (Implementation) SetReleases added in v3.11.14

func (o Implementation) SetReleases() Path

func (Implementation) SetRepositories added in v3.11.14

func (o Implementation) SetRepositories() Path

func (Implementation) SetReviewComments added in v3.11.14

func (o Implementation) SetReviewComments() Path

func (Implementation) SetReviews added in v3.11.14

func (o Implementation) SetReviews() Path

func (Implementation) SetTopics added in v3.11.14

func (o Implementation) SetTopics() Path

func (Implementation) SetUsers added in v3.11.14

func (o Implementation) SetUsers() Path

func (Implementation) String added in v3.11.14

func (o Implementation) String() string

func (Implementation) Topics added in v3.11.14

func (o Implementation) Topics() Path

func (Implementation) Users added in v3.11.14

func (o Implementation) Users() Path

type ListOptions added in v3.11.12

type ListOptions interface {
	HasSince() bool
	GetSince() time.Time
	SetSince(since time.Time) ListOptions
}

func NewListOptions added in v3.11.12

func NewListOptions() ListOptions

type MapIDInterface

type MapIDInterface interface {
	GetMappedID() id.NodeID
	SetMappedID(id.NodeID)
}

type MirrorDeleteFunc added in v3.11.5

type MirrorDeleteFunc func(ctx context.Context, destination NodeInterface, destinationParent Path)

type MirrorOptions

type MirrorOptions struct {
	// contains filtered or unexported fields
}

func NewMirrorOptions

func NewMirrorOptions(destinationTree TreeInterface) *MirrorOptions

func (*MirrorOptions) GetListOptions added in v3.11.12

func (o *MirrorOptions) GetListOptions() ListOptions

func (*MirrorOptions) SetDelete added in v3.11.5

func (o *MirrorOptions) SetDelete(delete MirrorDeleteFunc) *MirrorOptions

func (*MirrorOptions) SetListOptions added in v3.11.12

func (o *MirrorOptions) SetListOptions(listOptions ListOptions)

func (*MirrorOptions) SetUpsert added in v3.11.5

func (o *MirrorOptions) SetUpsert(upsert MirrorUpsertFunc) *MirrorOptions

type MirrorUpsertFunc added in v3.11.5

type MirrorUpsertFunc func(ctx context.Context, origin NodeInterface, originParent Path, destination NodeInterface, destinationParent Path)

type Node

type Node struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*Node) CreateChild

func (o *Node) CreateChild(ctx context.Context) NodeInterface

func (*Node) Delete

func (o *Node) Delete(ctx context.Context) NodeInterface

func (*Node) DeleteChild

func (o *Node) DeleteChild(id id.NodeID) NodeInterface

func (*Node) FromFormat

func (o *Node) FromFormat(f f3.Interface) NodeInterface

func (*Node) Get

func (o *Node) Get(ctx context.Context) NodeInterface

func (*Node) GetChild

func (o *Node) GetChild(id id.NodeID) NodeInterface

func (*Node) GetChildByIDOrName added in v3.11.4

func (o *Node) GetChildByIDOrName(ctx context.Context, childElement NodeInterface) NodeInterface

func (*Node) GetChildrenList added in v3.11.2

func (o *Node) GetChildrenList() ChildrenList

func (*Node) GetChildrenOrder added in v3.11.4

func (o *Node) GetChildrenOrder() []id.NodeID

func (*Node) GetCurrentPath

func (o *Node) GetCurrentPath() Path

func (*Node) GetDriver

func (o *Node) GetDriver() NodeDriverInterface

func (*Node) GetID

func (o *Node) GetID() id.NodeID

func (*Node) GetIDFromName

func (o *Node) GetIDFromName(ctx context.Context, name string) id.NodeID

func (*Node) GetImmutable added in v3.11.3

func (o *Node) GetImmutable() bool

func (*Node) GetIsNil

func (o *Node) GetIsNil() bool

func (*Node) GetIsSync

func (o *Node) GetIsSync() bool

func (*Node) GetKind

func (o *Node) GetKind() kind.Kind

func (*Node) GetMappedID

func (o *Node) GetMappedID() id.NodeID

func (*Node) GetName added in v3.11.4

func (o *Node) GetName() string

func (*Node) GetNodeChildren

func (o *Node) GetNodeChildren() NodeChildren

func (*Node) GetParent

func (o *Node) GetParent() NodeInterface

func (*Node) GetSupportedListOptions added in v3.11.13

func (o *Node) GetSupportedListOptions() SupportedListOptions

func (*Node) GetTree

func (o *Node) GetTree() TreeInterface

func (*Node) Init

func (o *Node) Init()

func (*Node) IsUpToDate added in v3.11.4

func (o *Node) IsUpToDate(other f3.Interface) bool

func (*Node) LookupMappedID

func (o *Node) LookupMappedID(ctx context.Context, id id.NodeID, f f3.Interface) id.NodeID

func (*Node) NewFormat

func (o *Node) NewFormat() f3.Interface

func (*Node) SetChild

func (o *Node) SetChild(child NodeInterface) NodeInterface

func (*Node) SetChildrenOrder added in v3.11.4

func (o *Node) SetChildrenOrder(childrenOrder []id.NodeID)

func (*Node) SetDriver

func (o *Node) SetDriver(driver NodeDriverInterface)

func (*Node) SetID

func (o *Node) SetID(id id.NodeID)

func (*Node) SetImmutable added in v3.11.3

func (o *Node) SetImmutable(immutable bool)

func (*Node) SetIsNil

func (o *Node) SetIsNil(isNil bool)

func (*Node) SetIsSync

func (o *Node) SetIsSync(sync bool)

func (*Node) SetKind

func (o *Node) SetKind(kind kind.Kind)

func (*Node) SetMappedID

func (o *Node) SetMappedID(mapped id.NodeID)

func (*Node) SetNodeChildren added in v3.11.2

func (o *Node) SetNodeChildren(children NodeChildren)

func (*Node) SetParent

func (o *Node) SetParent(parent NodeInterface)

func (*Node) SetTree

func (o *Node) SetTree(tree TreeInterface)

func (*Node) String

func (o *Node) String() string

func (*Node) ToFormat

func (o *Node) ToFormat() f3.Interface

func (*Node) Upsert

func (o *Node) Upsert(ctx context.Context) NodeInterface

type NodeAccessorsInterface

type NodeAccessorsInterface interface {
	SetIsNil(bool)
	GetIsNil() bool

	SetImmutable(bool)
	GetImmutable() bool

	SetIsSync(bool)
	GetIsSync() bool

	GetParent() NodeInterface
	SetParent(NodeInterface)

	GetKind() kind.Kind
	SetKind(kind.Kind)

	GetID() id.NodeID
	SetID(id.NodeID)

	GetTree() TreeInterface
	SetTree(TreeInterface)

	GetChildrenOrder() []id.NodeID
	SetChildrenOrder([]id.NodeID)

	GetNodeChildren() NodeChildren
	SetNodeChildren(NodeChildren)

	GetSupportedListOptions() SupportedListOptions
	GetChildrenList() ChildrenList

	GetDriver() NodeDriverInterface
	SetDriver(NodeDriverInterface)
}

type NodeChildren

type NodeChildren map[id.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

	GetSupportedListOptions() SupportedListOptions
	ListPage(context.Context, NodeInterface, ListOptions, int) ChildrenList

	GetIDFromName(context.Context, string) id.NodeID

	IsUpToDate(f3.Interface) bool

	Get(context.Context) bool
	Put(context.Context) id.NodeID
	Patch(context.Context)
	Delete(context.Context)

	NewFormat() f3.Interface
	FromFormat(f3.Interface)
	ToFormat() f3.Interface

	LookupMappedID(context.Context, id.NodeID, f3.Interface) id.NodeID

	String() string
}

func NewNullDriver

func NewNullDriver() NodeDriverInterface

type NodeDriverProxyInterface

type NodeDriverProxyInterface interface {
	MapIDInterface
	GetIDFromName(context.Context, string) id.NodeID
	GetChildByIDOrName(context.Context, NodeInterface) NodeInterface

	Get(context.Context) NodeInterface
	Upsert(context.Context) NodeInterface
	Delete(context.Context) NodeInterface

	NewFormat() f3.Interface
	FromFormat(f3.Interface) NodeInterface
	ToFormat() f3.Interface
	GetName() string
	IsUpToDate(f3.Interface) bool

	LookupMappedID(context.Context, id.NodeID, f3.Interface) id.NodeID
}

type NodeInterface

var (
	NilNode   NodeInterface = &Node{isNil: true}
	NilParent               = NilNode
)

func Find added in v3.11.3

func Find(self NodeInterface, p Path) NodeInterface

func FindAndGet added in v3.11.3

func FindAndGet(ctx context.Context, self NodeInterface, p Path) NodeInterface

func FindByIDOrName added in v3.11.4

func FindByIDOrName(ctx context.Context, self NodeInterface, p Path) NodeInterface

func MustFind added in v3.11.3

func MustFind(self NodeInterface, p Path) NodeInterface

func NewNode

func NewNode() NodeInterface

func NewNodeFromID

func NewNodeFromID(i string) NodeInterface

func NodeFactory added in v3.11.4

func NodeFactory(ctx context.Context, self TreeInterface, kind kind.Kind) NodeInterface

func NodeUnifyOne

func NodeUnifyOne(ctx context.Context, origin NodeInterface, originPath, path, destinationPath Path, options *MirrorOptions) NodeInterface

type NodeTreeInterface

type NodeTreeInterface interface {
	GetChild(id.NodeID) NodeInterface
	GetIDFromName(context.Context, string) id.NodeID
	SetChild(NodeInterface) NodeInterface
	DeleteChild(id.NodeID) NodeInterface
	CreateChild(context.Context) NodeInterface

	GetCurrentPath() Path
}

type NullDriver

type NullDriver struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*NullDriver) Delete

func (o *NullDriver) Delete(context.Context)

func (*NullDriver) FromFormat

func (o *NullDriver) FromFormat(f3.Interface)

func (*NullDriver) Get

func (o *NullDriver) Get(context.Context) bool

func (*NullDriver) GetIDFromName

func (o *NullDriver) GetIDFromName(ctx context.Context, name string) id.NodeID

func (*NullDriver) GetMappedID

func (o *NullDriver) GetMappedID() id.NodeID

func (*NullDriver) GetNode

func (o *NullDriver) GetNode() NodeInterface

func (*NullDriver) GetSupportedListOptions added in v3.11.13

func (o *NullDriver) GetSupportedListOptions() SupportedListOptions

func (*NullDriver) GetTreeDriver

func (o *NullDriver) GetTreeDriver() TreeDriverInterface

func (*NullDriver) IsNull

func (o *NullDriver) IsNull() bool

func (*NullDriver) IsUpToDate added in v3.11.4

func (o *NullDriver) IsUpToDate(other f3.Interface) bool

func (*NullDriver) ListPage

func (o *NullDriver) ListPage(ctx context.Context, node NodeInterface, _ ListOptions, page int) ChildrenList

func (*NullDriver) LookupMappedID

func (o *NullDriver) LookupMappedID(_ context.Context, _ id.NodeID, _ f3.Interface) id.NodeID

func (*NullDriver) NewFormat

func (o *NullDriver) NewFormat() f3.Interface

func (*NullDriver) Patch

func (o *NullDriver) Patch(context.Context)

func (*NullDriver) Put

func (*NullDriver) SetMappedID

func (o *NullDriver) SetMappedID(mapped id.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

type NullTreeDriver struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*NullTreeDriver) AllocateID

func (o *NullTreeDriver) AllocateID() bool

func (*NullTreeDriver) Diff

func (*NullTreeDriver) Factory

func (*NullTreeDriver) GetPageSize

func (o *NullTreeDriver) GetPageSize() int

func (*NullTreeDriver) GetRenameMap added in v3.11.6

func (o *NullTreeDriver) GetRenameMap() TreeRenameMap

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) SetRenameMap added in v3.11.6

func (o *NullTreeDriver) SetRenameMap(renameMap TreeRenameMap)

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) SetWhere

type Path

type Path interface {
	NodeIDs() []id.NodeID
	OwnerAndProjectID() (owner, project int64)

	AppendID(id string) Path
	Ignore() Path

	Length() int
	PathString() []string
	PathMappedString() []string
	MappedString() string
	String() string
	Append(child NodeInterface) Path
	RemoveFirst() Path
	PopFirst() (NodeInterface, Path)
	Pop() (NodeInterface, Path)
	RemoveLast() Path
	Empty() bool
	Get(int) NodeInterface
	First() NodeInterface
	Last() NodeInterface
	All() []NodeInterface

	Root() Path

	Forge() Path
	SetForge() Path

	Attachments() Path
	SetAttachments() Path

	Comments() Path
	SetComments() Path

	Issues() Path
	SetIssues() Path

	Labels() Path
	SetLabels() Path

	Milestones() Path
	SetMilestones() Path

	Owners() Path
	SetOwners(owners kind.Kind) Path

	Organizations() Path
	SetOrganizations() Path

	Projects() Path
	SetProjects() Path

	PullRequests() Path
	SetPullRequests() Path

	Reactions() Path
	SetReactions() Path

	Releases() Path
	SetReleases() Path

	Repositories() Path
	SetRepositories() Path

	Reviews() Path
	SetReviews() Path

	ReviewComments() Path
	SetReviewComments() Path

	Topics() Path
	SetTopics() Path

	Users() Path
	SetUsers() Path
}

func NewNodePathFromString added in v3.11.14

func NewNodePathFromString[T ~string](pathString T) Path

func NewPath

func NewPath(nodes ...NodeInterface) Path

func NewPathFromString

func NewPathFromString(allocator PathAllocator, pathString string) Path

func NodeCollectReferences

func NodeCollectReferences(ctx context.Context, node NodeInterface) []Path

func NodeUnifyPath

func NodeUnifyPath(ctx context.Context, origin NodeInterface, originPath, path, destinationPath Path, options *MirrorOptions) Path

func PathAbsolute

func PathAbsolute(allocator PathAllocator, current, destination string) Path

func TreeCollectReferences

func TreeCollectReferences(ctx context.Context, tree TreeInterface, p Path) []Path

func TreeMirror

func TreeMirror(ctx context.Context, originTree, destinationTree TreeInterface, originPath Path, options *MirrorOptions) Path

func TreePathRemap

func TreePathRemap(ctx context.Context, origin TreeInterface, p Path, destination TreeInterface) Path

func TreeUnifyPath

func TreeUnifyPath(ctx context.Context, origin TreeInterface, p Path, destination TreeInterface, options *MirrorOptions) Path

type PathAllocator added in v3.11.14

type PathAllocator func() NodeInterface

type SetFunc added in v3.11.4

type SetFunc func(parent Path, node NodeInterface)

type SupportedListOptions added in v3.11.13

type SupportedListOptions int64

func (SupportedListOptions) Since added in v3.11.13

func (o SupportedListOptions) Since() bool

type Tree

type Tree struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*Tree) AllocateID

func (o *Tree) AllocateID() bool

func (*Tree) Apply

func (o *Tree) Apply(ctx context.Context, p Path, options *ApplyOptions) bool

func (*Tree) ApplyAndGet

func (o *Tree) ApplyAndGet(ctx context.Context, path Path, options *ApplyOptions) bool

func (*Tree) Diff

func (o *Tree) Diff(a, b NodeInterface) string

func (*Tree) Exists

func (o *Tree) Exists(ctx context.Context, path Path) bool

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) FindByIDOrName added in v3.11.4

func (o *Tree) FindByIDOrName(ctx context.Context, path Path) NodeInterface

func (*Tree) GetChildrenKind

func (o *Tree) GetChildrenKind(parentKind kind.Kind) kind.Kind

func (*Tree) GetDriver

func (o *Tree) GetDriver() TreeDriverInterface

func (*Tree) GetFactory added in v3.11.4

func (o *Tree) GetFactory(kind kind.Kind) FactoryFun

func (*Tree) GetOptions

func (o *Tree) GetOptions() options.Interface

func (*Tree) GetPageSize

func (o *Tree) GetPageSize() int

func (*Tree) GetRenameMap added in v3.11.6

func (o *Tree) GetRenameMap() TreeRenameMap

func (*Tree) GetRoot

func (o *Tree) GetRoot() NodeInterface

func (*Tree) Init

func (o *Tree) Init(opts options.Interface)

func (*Tree) MustFind

func (o *Tree) MustFind(path Path) NodeInterface

func (*Tree) SetDriver

func (o *Tree) SetDriver(driver TreeDriverInterface)

func (*Tree) SetFactory added in v3.11.4

func (o *Tree) SetFactory(kind kind.Kind, factory FactoryFun)

func (*Tree) SetOptions

func (o *Tree) SetOptions(opts options.Interface)

func (*Tree) SetRenameMap added in v3.11.6

func (o *Tree) SetRenameMap(renameMap TreeRenameMap)

func (*Tree) SetRoot

func (o *Tree) SetRoot(root NodeInterface)

func (*Tree) Walk

func (o *Tree) Walk(ctx context.Context, options *WalkOptions)

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)

	GetRenameMap() TreeRenameMap
	SetRenameMap(TreeRenameMap)

	AllocateID() bool

	Init()

	Diff(a, b NodeDriverInterface) string

	Factory(ctx context.Context, kind 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(options.Interface)

	GetOptions() options.Interface
	SetOptions(options.Interface)

	SetRoot(NodeInterface)
	GetRoot() NodeInterface

	SetLogger(logger.Interface)
	GetLogger() logger.Interface

	GetRenameMap() TreeRenameMap
	SetRenameMap(TreeRenameMap)

	GetDriver() TreeDriverInterface
	SetDriver(TreeDriverInterface)

	SetFactory(kind kind.Kind, factory FactoryFun)
	GetFactory(kind kind.Kind) FactoryFun

	GetChildrenKind(kind.Kind) kind.Kind

	GetPageSize() int

	AllocateID() bool

	Diff(a, b NodeInterface) string

	MustFind(Path) NodeInterface
	Find(Path) NodeInterface
	FindByIDOrName(ctx context.Context, path 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
}

func NewTree

func NewTree(opts options.Interface) TreeInterface

type TreeRenameMap added in v3.11.6

type TreeRenameMap map[kind.Kind]map[string]string

type WalkFunc

type WalkFunc func(context.Context, Path, NodeInterface)

type WalkOptions

type WalkOptions struct {
	// contains filtered or unexported fields
}

func NewWalkOptions

func NewWalkOptions(fun WalkFunc) *WalkOptions

func (*WalkOptions) GetListOptions added in v3.11.12

func (o *WalkOptions) GetListOptions() ListOptions

func (*WalkOptions) SetListOptions added in v3.11.12

func (o *WalkOptions) SetListOptions(listOptions ListOptions)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL