Documentation ¶
Index ¶
- func ExtractName(path string) string
- func GetFileContent(path string) ([]byte, error)
- func GetSourceTreeStructure(tree *SourceTree, level int) (string, error)
- func IsDirectory(path string) bool
- func IsMarkdownFile(path string) bool
- func IsProgrammingFile(path string) bool
- func IsSensitiveFile(path string) bool
- func IsSupportedFile(path string) bool
- func IsUnwantedFilesAndFolders(path string) bool
- func SaveFileContent(outputPath string, data []byte) error
- func ValidatePath(path string) bool
- type SourceCollector
- type SourceNode
- type SourceTree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileContent ¶
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 ¶
IsDirectory checks if the path is a directory or not
func IsMarkdownFile ¶
IsMarkdownFile checks if the file is a markdown file or not
func IsProgrammingFile ¶
IsProgrammingFile checks if the file is a programming file or not
func IsSensitiveFile ¶
IsSensitiveFile checks if the file or directory is sensitive or not
func IsSupportedFile ¶
IsSupportedFile checks if the file is valid or not
func IsUnwantedFilesAndFolders ¶
IsUnwantedFilesAndFolders checks if the file or directory is unwanted or not
func SaveFileContent ¶
SaveFileContent saves the file content to the output path, in append mode
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