analyze

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package analyze provides functionality for analyzing directory structures

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	Analyze() (*Result, error)
}

Analyzer is the interface for analyzing sources

type Exporter

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

Exporter handles exporting nodes to different formats

func NewExporter

func NewExporter(nodes []*parse.Node) *Exporter

NewExporter creates a new exporter

func (*Exporter) ToJSON

func (e *Exporter) ToJSON() (string, error)

ToJSON exports nodes as JSON format

func (*Exporter) ToTree

func (e *Exporter) ToTree() (string, error)

ToTree exports nodes as plain-text tree format

func (*Exporter) ToTreeForBuild

func (e *Exporter) ToTreeForBuild() (string, error)

ToTree actually returns the simple format for build compatibility

func (*Exporter) ToTreeSimple

func (e *Exporter) ToTreeSimple() (string, error)

ToTreeSimple exports nodes as simple indented format (compatible with build command)

func (*Exporter) ToYAML

func (e *Exporter) ToYAML() (string, error)

ToYAML exports nodes as YAML format

type Filter

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

Filter handles filtering of unwanted files and directories

func NewFilter

func NewFilter() *Filter

NewFilter creates a new filter with default ignore patterns

func (*Filter) GetFilteredExtension

func (f *Filter) GetFilteredExtension(filename string) (string, bool)

GetFilteredExtension checks if an extension should be filtered

func (*Filter) ShouldFilter

func (f *Filter) ShouldFilter(name string, isDir bool) bool

ShouldFilter returns true if the given path should be filtered out

type LocalAnalyzer

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

LocalAnalyzer analyzes local directory structures

func NewLocalAnalyzer

func NewLocalAnalyzer(sourcePath string, maxDepth int) *LocalAnalyzer

NewLocalAnalyzer creates a new local directory analyzer

func (*LocalAnalyzer) Analyze

func (a *LocalAnalyzer) Analyze() (*Result, error)

Analyze performs the analysis of the local directory

type Result

type Result struct {
	Nodes         []*parse.Node // The analyzed structure
	DirCount      int           // Number of directories found
	FileCount     int           // Number of files found
	FilteredCount int           // Number of items filtered out
	TotalScanned  int           // Total items scanned before filtering
}

Result contains the analysis results

Jump to

Keyboard shortcuts

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