magic

package
v0.0.0-...-1ffd3ba Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MAGIC_NONE              = C.MAGIC_NONE
	MAGIC_DEBUG             = C.MAGIC_DEBUG
	MAGIC_SYMLINK           = C.MAGIC_SYMLINK
	MAGIC_COMPRESS          = C.MAGIC_COMPRESS
	MAGIC_DEVICES           = C.MAGIC_DEVICES
	MAGIC_MIME_TYPE         = C.MAGIC_MIME_TYPE
	MAGIC_CONTINUE          = C.MAGIC_CONTINUE
	MAGIC_CHECK             = C.MAGIC_CHECK
	MAGIC_PRESERVE_ATIME    = C.MAGIC_PRESERVE_ATIME
	MAGIC_RAW               = C.MAGIC_RAW
	MAGIC_ERROR             = C.MAGIC_ERROR
	MAGIC_MIME_ENCODING     = C.MAGIC_MIME_ENCODING
	MAGIC_MIME              = C.MAGIC_MIME
	MAGIC_EXTENSION         = C.MAGIC_EXTENSION
	MAGIC_APPLE             = C.MAGIC_APPLE
	MAGIC_NO_CHECK_COMPRESS = C.MAGIC_NO_CHECK_COMPRESS
	MAGIC_NO_CHECK_TAR      = C.MAGIC_NO_CHECK_TAR
	MAGIC_NO_CHECK_SOFT     = C.MAGIC_NO_CHECK_SOFT
	MAGIC_NO_CHECK_APPTYPE  = C.MAGIC_NO_CHECK_APPTYPE
	MAGIC_NO_CHECK_ELF      = C.MAGIC_NO_CHECK_ELF
	MAGIC_NO_CHECK_TEXT     = C.MAGIC_NO_CHECK_TEXT
	MAGIC_NO_CHECK_CDF      = C.MAGIC_NO_CHECK_CDF
	MAGIC_NO_CHECK_TOKENS   = C.MAGIC_NO_CHECK_TOKENS
	MAGIC_NO_CHECK_ENCODING = C.MAGIC_NO_CHECK_ENCODING
	MAGIC_NO_CHECK_ASCII    = C.MAGIC_NO_CHECK_ASCII
	MAGIC_NO_CHECK_FORTRAN  = C.MAGIC_NO_CHECK_FORTRAN
	MAGIC_NO_CHECK_TROFF    = C.MAGIC_NO_CHECK_TROFF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Magic

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

A handle to manage the library.

func NewMagicHandle

func NewMagicHandle(flags int) *Magic

func (*Magic) Buffer

func (self *Magic) Buffer(b []byte) string

func (*Magic) Check

func (self *Magic) Check(filename string) int

func (*Magic) Close

func (self *Magic) Close()

func (*Magic) Compile

func (self *Magic) Compile(filename string) int

func (*Magic) Errno

func (self *Magic) Errno() int

func (*Magic) Error

func (self *Magic) Error() string

func (*Magic) File

func (self *Magic) File(filename string) string

func (*Magic) Load

func (self *Magic) Load(filename string) int

func (*Magic) LoadBuffer

func (self *Magic) LoadBuffer(data string) int

Load definitions from this buffer.

func (*Magic) SetFlags

func (self *Magic) SetFlags(flags int) int

Jump to

Keyboard shortcuts

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