magic

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentType

func ContentType(path string) (ct string, err error)

func GetBytes

func GetBytes(path string) (b []byte, err error)

func GetReader

func GetReader(path string) (r io.Reader, err error)

Types

type FileMagic

type FileMagic struct {
	Enum Magic
	// contains filtered or unexported fields
}

func GetFileMagic

func GetFileMagic(path string) (FileMagic, error)

func (FileMagic) String

func (fm FileMagic) String() string

type Magic

type Magic int
const (
	MagicGzip Magic = iota
	MagicPosixTar
	MagicGnuTar
	MagicBzip
	MagicMP3
	MagicElf
	MagicXZ
)

type MagicBytes

type MagicBytes struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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