programkind

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArchiveMap = map[string]bool{
	".apk":    true,
	".bz2":    true,
	".bzip2":  true,
	".deb":    true,
	".gem":    true,
	".gz":     true,
	".jar":    true,
	".rpm":    true,
	".tar":    true,
	".tar.gz": true,
	".tar.xz": true,
	".tgz":    true,
	".upx":    true,
	".whl":    true,
	".xz":     true,
	".zip":    true,
}

Supported archive extensions.

View Source
var ErrUPXNotFound = errors.New("UPX executable not found in PATH")

Functions

func GetExt added in v1.7.1

func GetExt(path string) string

getExt returns the extension of a file path and attempts to avoid including fragments of filenames with other dots before the extension.

func IsSupportedArchive added in v1.7.1

func IsSupportedArchive(path string) bool

IsSupportedArchive returns whether a path can be processed by our archive extractor. UPX files are an edge case since they may or may not even have an extension that can be referenced.

func IsValidUPX added in v1.8.0

func IsValidUPX(header []byte, path string) (bool, error)

IsValidUPX checks whether a suspected UPX-compressed file can be decompressed with UPX.

func UPXInstalled added in v1.8.0

func UPXInstalled() error

Types

type FileType

type FileType struct {
	Ext  string
	MIME string
}

func File

func File(path string) (*FileType, error)

File detects what kind of program this file might be.

func Path

func Path(path string) *FileType

Path returns a filetype based strictly on file path.

Jump to

Keyboard shortcuts

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