Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidMime = errors.New("Invalid mime")
View Source
var ErrSkip = errors.New("Skip")
Functions ¶
func RegisterMimeProvider ¶
func RegisterMimeProvider(name string, provider MimeTypeProvider)
func RegisterProvider ¶
func RegisterProvider(name string, provider FileInfoProvider)
Types ¶
type FileInfoProvider ¶
type FileInfoProvider interface { // indicate how many bytes you need at minimum to be able to determine // your specific file info. you won't get more than provided. in case you // need all the data, please return -1. In case the provided mime type doesn't // suit you and you know you won't be able to do anything with the data, returning // any error from here will skip the provider MinimumBytes(typ, subtyp string) (int64, error) Check(filename string, reader io.Reader) ([]byte, error) Render(data []byte) (string, string, error) }
func GetProvider ¶
func GetProvider(name string) (FileInfoProvider, error)
Click to show internal directories.
Click to hide internal directories.