magic

package
v7.5.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decompress

func Decompress(r io.Reader, ctype CompressionType) (io.Reader, error)

func DetectCompressed

func DetectCompressed(f *os.File) (FileType, CompressionType)

Types

type CompressionType

type CompressionType int
const (
	CompressedNone CompressionType = iota
	CompressedGzip
	CompressedXz
)

type FileType

type FileType int
const (
	FileTypeUnknown FileType = iota
	FileTypeRPM
	FileTypeDEB
	FileTypePGP
	FileTypeJAR
	FileTypePKCS7
	FileTypePECOFF
	FileTypeMSI
	FileTypeCAB
	FileTypeAppManifest
	FileTypeCAT
	FileTypeAPPX
	FileTypeVSIX
	FileTypeXAP
	FileTypeAPK
	FileTypeMachO
	FileTypeMachOFat
	FileTypeIPA
	FileTypeXAR
)

func Detect

func Detect(r io.Reader) FileType

Detect a handful of package and signature file types based on the first few bytes of the file contents.

Jump to

Keyboard shortcuts

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