Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Renamer ¶
type Renamer struct{}
Renamer provides node renaming functionality with reference updates.
func (*Renamer) Rename ¶
Rename changes a node's ID and updates all references pointing to it. Returns a new slice with the renamed node and updated references. The original nodes slice is not modified.
Parameters:
- nodes: slice of all nodes in the graph
- oldID: the current ID of the node to rename
- newID: the new ID for the node
Returns:
- updated slice of nodes with the rename applied
- error if oldID doesn't exist, newID already exists, or IDs are invalid
func (*Renamer) UpdateReferences ¶
UpdateReferences updates all references from oldID to newID across all nodes. Unlike Rename, this does not require oldID to exist as a node - useful for detecting manual renames where the old node file was already deleted/renamed. Returns a new slice with updated references. Nodes whose references were updated will have their version incremented.
Click to show internal directories.
Click to hide internal directories.