programkind

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 9 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,
	".whl":    true,
	".xz":     true,
	".zip":    true,
}

Supported archive extensions.

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.

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