Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
Node represents a file or directory in the AST.
func (*Node) AllDescendants ¶
AllDescendants returns all descendant nodes recursively.
func (*Node) ImmediateChildren ¶
ImmediateChildren returns the immediate child nodes.
type Walker ¶
type Walker struct { FollowSymlinks bool // contains filtered or unexported fields }
Walker traverses the file system and builds the AST.
func NewWalker ¶
func NewWalker(opts ...WalkerOption) (*Walker, error)
NewWalker creates a new Walker with the provided options.
func (*Walker) GetNodeByPath ¶
GetNodeByPath retrieves a node by its path.
func (*Walker) GetNodeByRelativePath ¶
GetNodeByRelativePath retrieves a node by a path relative to a base node.
type WalkerOption ¶
type WalkerOption func(*Walker)
WalkerOption defines a function type for configuring the Walker.
func WithFilter ¶
func WithFilter(filter func(node *Node) bool) WalkerOption
WithFilter sets a filter function for the Walker.
func WithFollowSymlinks ¶
func WithFollowSymlinks(follow bool) WalkerOption
WithFollowSymlinks sets whether the walker should follow symbolic links.
func WithPaths ¶
func WithPaths(paths []string) WalkerOption
WithPaths sets the paths for the Walker.
Click to show internal directories.
Click to hide internal directories.