file

package
v0.0.0-...-1a4da24 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) bool

Exists Check to see if a path exists

func GetCompressedFiles

func GetCompressedFiles(files []scan.File, rootPath string) (newfiles []scan.File, compresspaths []string, err error)

GetCompressedFiles provides all the files contained within compressed files

func GetConvertedFiles

func GetConvertedFiles(files []scan.File) (convertedFiles []scan.File, convertedPaths []string)

GetConvertedFiles converts files into plaintext

func GetFileFromStream

func GetFileFromStream(cfg *cfgreader.EarlybirdConfig) []scan.File

GetFileFromStream Builds a file as a collection of lines from the input stream. This will be fed to the scan modules.

func GetFileSize

func GetFileSize(path string) (size int64, err error)

GetFileSize returns the file size of target file

func GetWD

func GetWD() (string, error)

GetWD Gets the current working directory

func IsEmpty

func IsEmpty(path string) (bool, error)

IsEmpty Check to see if a directory is empty

func MultipartToScanFiles

func MultipartToScanFiles(files []*multipart.FileHeader, cfg cfgreader.EarlybirdConfig) (fileList []scan.File, err error)

MultipartToScanFiles converts the multipart file upload into Earlybird files

func Uncompress

func Uncompress(src string, dest string) (filenames []string, err error)

Uncompress decompresses zip files safely

Types

type Context

type Context struct {
	Files                                                     []scan.File
	CompressPaths, ConvertPaths, IgnorePatterns, SkippedFiles []string
}

Context is the file system context used for the scan process

func GetFiles

func GetFiles(searchDir, ignoreFile string, verbose bool, maxFileSize int64) (fileContext Context, err error)

GetFiles Build the list of files

func GetGitFiles

func GetGitFiles(fileType string, cfg *cfgreader.EarlybirdConfig) (fileContext Context, err error)

GetGitFiles Builds the list of staged or tracked files

Jump to

Keyboard shortcuts

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