pkg

package
v0.0.0-...-0489168 Latest Latest
Warning

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

Go to latest
Published: May 18, 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 GetSourceTreeStructure

func GetSourceTreeStructure(tree *SourceTree, level int) (string, error)

GetSourceTreeStructure generates the source tree in a tree structure (string) for better understanding

func IsDirectory

func IsDirectory(path string) bool

IsDirectory checks if the path is a directory or not

func IsMarkdownFile

func IsMarkdownFile(path string) bool

IsMarkdownFile checks if the file is a markdown file or not

func IsProgrammingFile

func IsProgrammingFile(path string) bool

IsProgrammingFile checks if the file is a programming file or not

func IsSensitiveFile

func IsSensitiveFile(path string) bool

IsSensitiveFile checks if the file or directory is sensitive or not

func IsSupportedFile

func IsSupportedFile(path string) bool

IsSupportedFile checks if the file is valid or not

func IsUnwantedFilesAndFolders

func IsUnwantedFilesAndFolders(path string) bool

IsUnwantedFilesAndFolders checks if the file or directory is unwanted or not

func SaveFileContent

func SaveFileContent(outputPath string, data []byte) error

SaveFileContent saves the file content to the output path, in append mode

func ValidatePath

func ValidatePath(path string) bool

ValidatePath validates the path

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
}

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

func (sc *SourceCollector) Save() 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

func GenerateSourceTree

func GenerateSourceTree(path string) *SourceTree

GenerateSourceTree returns a the source tree

Jump to

Keyboard shortcuts

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