Documentation ¶
Index ¶
Constants ¶
View Source
const BytesThreshold = 1024
BytesThreshold is the size of the validation buffer.
Variables ¶
This section is empty.
Functions ¶
func ValidateMimeTypePattern ¶
ValidateMimeTypePattern validates that the checks extracted from pattern can be used as glob patterns against mime types.
Types ¶
type Check ¶
type Check struct {
// contains filtered or unexported fields
}
Check holds info on a specific test check is a string/mimetype to be matched negate indicates if the check should be handled as a blacklist or a whitelist.
type ErrMimeTypeMismatch ¶
type ErrMimeTypeMismatch struct {
// contains filtered or unexported fields
}
ErrMimeTypeMismatch is a custom error exposing info on the given failed check.
func (ErrMimeTypeMismatch) Error ¶
func (e ErrMimeTypeMismatch) Error() string
Error returns the error string for the current ErrMimeTypeMismatch.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator checks its buffer's mime type against the provided checks. It holds a reference to a mime type decoder.
func (*Validator) CheckBuffer ¶
CheckBuffer performs mime types checks against the provided byte slice.
Click to show internal directories.
Click to hide internal directories.