pkg

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractName

func ExtractName(path string) string

ExtractName extracts the name from the path

func GetFileContent

func GetFileContent(path string) ([]byte, error)

GetFileContent returns the file content

func IsDirectory

func IsDirectory(path string) bool

IsDirectory checks if the path is a directory or not

func IsValidPath

func IsValidPath(path string) bool

IsValidPath checks if the path is valid or not

Types

type SourceCollector

type SourceCollector struct {
	// Input of the source code
	Input string

	// Output of the source code
	Output string

	// BasePath of the source code
	BasePath string

	// Validator of the source code
	Validator validators.Validator
}

SourceCollector is a struct that holds the input and output of the source code

func NewSourceCollector

func NewSourceCollector(input string, output string) (*SourceCollector, error)

NewSourceCollector creates a new SourceCollector

func (*SourceCollector) GenerateSourceTree

func (sc *SourceCollector) GenerateSourceTree() (*SourceTree, error)

GenerateSourceTree generates the source tree

func (*SourceCollector) GenerateSourceTreeStructure

func (sc *SourceCollector) GenerateSourceTreeStructure(sourceTree *SourceTree) (string, error)

GenerateSourceTreeStructure generates the source tree structure in string format

func (*SourceCollector) Save

func (sc *SourceCollector) Save(sourceTree *SourceTree, sourceTreeStructure string) error

Save saves the source tree to the output path

type SourceNode

type SourceNode struct {
	// Name of the source code node
	Name string

	// Path of the source code node
	Path string
}

SourceNode is a struct that holds the source code node structure

type SourceTree

type SourceTree struct {
	// Root of the source code tree
	Root *SourceNode

	// Nodes of the source code tree
	Nodes []*SourceTree
}

SourceTree is a struct that holds the source code tree structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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