Documentation
¶
Overview ¶
Package metadata — GoCut project extractor (.gocut).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(extractor Extractor)
Register adds a custom extractor ahead of built-ins so domain formats can override signature or extension detection.
func RegisterCustom ¶
func RegisterCustom(name string, match MatchFunc, extract ExtractFunc)
RegisterCustom registers a named custom extractor from functions.
func Unregister ¶
func Unregister(name string)
Unregister removes extractors with the supplied name.
Types ¶
type DateMetadata ¶
DateMetadata is embedded media date information read from a file.
type ExtractFunc ¶
ExtractFunc extracts metadata from a sample.
type Extractor ¶
Extractor is the in-process extension point for built-in and custom formats.
func NewFuncExtractor ¶
func NewFuncExtractor(name string, match MatchFunc, extract ExtractFunc) Extractor
NewFuncExtractor creates an extractor from match and extraction functions.
type FuncExtractor ¶
type FuncExtractor struct {
// contains filtered or unexported fields
}
FuncExtractor adapts functions to Extractor.
func (*FuncExtractor) Extract ¶
func (e *FuncExtractor) Extract(sample Sample) (Result, error)
Extract runs the extractor function.
func (*FuncExtractor) Match ¶
func (e *FuncExtractor) Match(sample Sample) bool
Match reports whether the extractor handles the sample.
type Result ¶
type Result struct {
Format string `json:"format"`
MIMEType string `json:"mime_type,omitempty"`
Category string `json:"category,omitempty"`
Date DateMetadata `json:"date,omitempty"`
Fields map[string]string `json:"fields,omitempty"`
}
Result contains format detection and the metadata extracted from a file.