Documentation ¶
Index ¶
- Variables
- func Is3gp(r io.ReadSeeker) bool
- func IsApk(r io.ReadSeeker) bool
- func IsAvif(r io.ReadSeeker) bool
- func IsBmp(r io.ReadSeeker) bool
- func IsDib(r io.ReadSeeker) bool
- func IsFlv(r io.ReadSeeker) bool
- func IsGif(r io.ReadSeeker) bool
- func IsGzip(r io.ReadSeeker) bool
- func IsJar(r io.ReadSeeker) bool
- func IsJpeg(r io.ReadSeeker) bool
- func IsMkv(r io.ReadSeeker) bool
- func IsMp3(r io.ReadSeeker) bool
- func IsMp4(r io.ReadSeeker) bool
- func IsMpg(r io.ReadSeeker) bool
- func IsMsOffice(r io.ReadSeeker) bool
- func IsOneOf(r io.ReadSeeker, functions ...function) bool
- func IsPdf(r io.ReadSeeker) bool
- func IsPng(r io.ReadSeeker) bool
- func IsRar(r io.ReadSeeker) bool
- func IsSvg(r io.ReadSeeker) bool
- func IsSwf(r io.ReadSeeker) bool
- func IsTiff(r io.ReadSeeker) bool
- func IsWebp(r io.ReadSeeker) bool
- func IsZip(r io.ReadSeeker) bool
Constants ¶
This section is empty.
Variables ¶
var ( AVIF = []byte{0x00, 0x00, 0x00} BMP = []byte{0x42, 0x4D} DIB_0 = []byte{0x42, 0x4D} DIB_1 = []byte{0x28, 0x00} GIF = []byte{0x47, 0x49, 0x46, 0x38} TIFF = []byte{0x49, 0x49, 0x2A, 0x00} MP3 = []byte{0x49, 0x44, 0x33} MPG_0 = []byte{0x00, 0x00, 0x01, 0xB3} MPG_1 = []byte{0x00, 0x00, 0x01, 0xBA} FLV = []byte{0x46, 0x4C, 0x56} APK = []byte{0x50, 0x4B, 0x03, 0x04} MS_OFFICE = []byte{0x50, 0x4B, 0x03, 0x04} JAR = []byte{0x50, 0x4B, 0x03, 0x04} SWF_0 = []byte{0x43, 0x57, 0x53} SWF_1 = []byte{0x46, 0x57, 0x53} PNG = []byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A} JPEG = []byte{0xFF, 0xD8} MP4_0 = []byte{0x00, 0x00, 0x00, 0x14, 0x66, 0x74, 0x79, 0x70, 0x69, 0x73, 0x6F, 0x6D} MP4_1 = []byte{0x00, 0x00, 0x00, 0x18, 0x66, 0x74, 0x79, 0x70} MP4_2 = []byte{0x00, 0x00, 0x00, 0x1C, 0x66, 0x74, 0x79, 0x70} THREE_GP_0 = []byte{0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70} THREE_GP_1 = []byte{0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70} THREE_GP_2 = []byte{0x00, 0x00, 0x00, 0x14, 0x66, 0x74, 0x79, 0x70} MKV = []byte{0x1A, 0x45, 0xDF, 0xA3} PDF = []byte{0x25, 0x50, 0x44, 0x46} RAR = []byte{0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x00} GZIP = []byte{0x1F, 0x8B, 0x08} ZIP_0 = []byte{0x50, 0x4B, 0x03, 0x04} ZIP_1 = []byte{0x50, 0x4B, 0x05, 0x06} ZIP_2 = []byte{0x50, 0x4B, 0x07, 0x08} WEBP = []byte{0x52, 0x49, 0x46, 0x46} HtmlCommentRegex = regexp.MustCompile(`(?i)<!--([\s\S]*?)-->`) SvgRegex = regexp.MustCompile(`(?i)^\s*(?:<\?xml[^>]*>\s*)?(?:<!doctype svg[^>]*>\s*)?<svg[^>]*>[^*]*<\/svg>\s*$`) )
Functions ¶
func Is3gp ¶
func Is3gp(r io.ReadSeeker) bool
Is3gp function will return true if File is a valid 3gp
func IsApk ¶
func IsApk(r io.ReadSeeker) bool
IsApk function will return true if File is a valid APK
func IsAvif ¶
func IsAvif(r io.ReadSeeker) bool
IsAvif function will return true if File is a valid AVIF
func IsBmp ¶
func IsBmp(r io.ReadSeeker) bool
IsBmp function will return true if File is a valid BMP
func IsDib ¶
func IsDib(r io.ReadSeeker) bool
IsDib function will return true if File is a valid DIB
func IsFlv ¶
func IsFlv(r io.ReadSeeker) bool
IsFlv function will return true if File is a valid FLV
func IsGif ¶
func IsGif(r io.ReadSeeker) bool
IsGif function will return true if File is a valid GIF
func IsGzip ¶
func IsGzip(r io.ReadSeeker) bool
IsGzip function will return true if File is a valid GZIP
func IsJar ¶
func IsJar(r io.ReadSeeker) bool
IsJar function will return true if File is a valid JAR (Java Archive)
func IsJpeg ¶
func IsJpeg(r io.ReadSeeker) bool
IsJpeg function will return true if File is a valid JPEG
func IsMkv ¶
func IsMkv(r io.ReadSeeker) bool
IsMkv function will return true if File is a valid MKV
func IsMp3 ¶
func IsMp3(r io.ReadSeeker) bool
IsMp3 function will return true if File is a valid MP3
func IsMp4 ¶
func IsMp4(r io.ReadSeeker) bool
func IsMpg ¶
func IsMpg(r io.ReadSeeker) bool
IsMpg function will return true if File is a valid MPG
func IsMsOffice ¶
func IsMsOffice(r io.ReadSeeker) bool
IsMsOffice function will return true if File is a valid MS OFFICE Document (DOCX|PPTX|XLSX)
func IsOneOf ¶
func IsOneOf(r io.ReadSeeker, functions ...function) bool
IsOneOf function will validate File with multiple function
func IsPdf ¶
func IsPdf(r io.ReadSeeker) bool
IsPdf function will return true if File is a valid PDF
func IsPng ¶
func IsPng(r io.ReadSeeker) bool
IsPng function will return true if File is a valid PNG
func IsRar ¶
func IsRar(r io.ReadSeeker) bool
IsRar function will return true if File is a valid RAR
func IsSvg ¶ added in v1.0.2
func IsSvg(r io.ReadSeeker) bool
IsSvg function will return true if File is a valid SVG
func IsSwf ¶
func IsSwf(r io.ReadSeeker) bool
IsSwf function will return true if File is a valid SWF
func IsTiff ¶
func IsTiff(r io.ReadSeeker) bool
IsTiff function will return true if File is a valid TIFF
func IsWebp ¶
func IsWebp(r io.ReadSeeker) bool
IsWebp function will return true if File is a valid Webp
func IsZip ¶
func IsZip(r io.ReadSeeker) bool
IsZip function will return true if File is a valid ZIP
Types ¶
This section is empty.