magicbyte

package
v0.0.0-...-e8b0599 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknown = fmt.Errorf("unknown file type")

ErrUnknown infers the file type cannot be determined by the provided magic bytes

Functions

This section is empty.

Types

type FileType

type FileType struct {
	Description string
	MIME        string
	Extension   string
	Magic       []byte
	Offset      int
	// contains filtered or unexported fields
}

FileType provides information about the type of the file inferred from the provided magic bytes

func Lookup

func Lookup(bytes []byte) (*FileType, error)

Provide at least the first 1024 bytes. A magic.ErrUnknown will be returned if unknown

Jump to

Keyboard shortcuts

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