Documentation ¶
Index ¶
- Constants
- Variables
- func AddMatcher(fileType types.Type, matcher matchers.Matcher) matchers.TypeMatcher
- func AddType(ext, mime string) types.Type
- func Archive(buf []byte) (types.Type, error)
- func Audio(buf []byte) (types.Type, error)
- func Font(buf []byte) (types.Type, error)
- func Get(buf []byte) (types.Type, error)
- func GetType(ext string) types.Type
- func Image(buf []byte) (types.Type, error)
- func Is(buf []byte, ext string) bool
- func IsArchive(buf []byte) bool
- func IsAudio(buf []byte) bool
- func IsExtension(buf []byte, ext string) bool
- func IsFont(buf []byte) bool
- func IsImage(buf []byte) bool
- func IsMIME(buf []byte, mime string) bool
- func IsMIMESupported(mime string) bool
- func IsSupported(ext string) bool
- func IsType(buf []byte, kind types.Type) bool
- func IsVideo(buf []byte) bool
- func Match(buf []byte) (types.Type, error)
- func MatchFile(filepath string) (types.Type, error)
- func MatchMap(buf []byte, matchers matchers.Map) types.Type
- func MatchReader(reader io.Reader) (types.Type, error)
- func Matches(buf []byte) bool
- func MatchesMap(buf []byte, matchers matchers.Map) bool
- func Video(buf []byte) (types.Type, error)
Constants ¶
View Source
const Version = "1.0.2"
Version exposes the current package version.
Variables ¶
View Source
var ErrEmptyBuffer = errors.New("Empty buffer")
ErrEmptyBuffer represents an empty buffer error
View Source
var ErrUnknownBuffer = errors.New("Unknown buffer type")
ErrUnknownBuffer represents a unknown buffer error
View Source
var Matchers = matchers.Matchers
Matchers is an alias to matchers.Matchers
View Source
var NewMatcher = matchers.NewMatcher
NewMatcher is an alias to matchers.NewMatcher
View Source
var NewType = types.NewType
NewType creates and registers a new type
View Source
var Types = types.Types
Types stores a map of supported types
View Source
var Unknown = types.Unknown
Unknown represents an unknown file type
Functions ¶
func AddMatcher ¶
AddMatcher registers a new matcher type
func IsMIMESupported ¶
IsMIMESupported checks if a given MIME type is supported
func IsSupported ¶
IsSupported checks if a given file extension is supported
func MatchReader ¶
MatchReader is convenient wrapper to Match() any Reader
func MatchesMap ¶
MatchesMap is an alias to Matches() but using matching againts a map of match functions
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.