Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeHandler ¶
type CodeHandler struct{}
CodeHandler extracts metadata from source code files
func (*CodeHandler) CanHandle ¶
func (h *CodeHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*CodeHandler) Extract ¶
func (h *CodeHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from a source code file
func (*CodeHandler) SupportedExtensions ¶ added in v0.14.0
func (h *CodeHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports
type DocxHandler ¶
type DocxHandler struct{}
DocxHandler extracts metadata from DOCX files
func (*DocxHandler) CanHandle ¶
func (h *DocxHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*DocxHandler) Extract ¶
func (h *DocxHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from a DOCX file
func (*DocxHandler) SupportedExtensions ¶ added in v0.14.0
func (h *DocxHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor extracts metadata from files
func (*Extractor) RegisterHandler ¶
func (e *Extractor) RegisterHandler(handler FileHandler)
RegisterHandler registers a file type handler for all its supported extensions
type FileHandler ¶
type FileHandler interface {
Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
CanHandle(ext string) bool
// SupportedExtensions returns the list of extensions this handler supports
SupportedExtensions() []string
}
FileHandler extracts metadata for a specific file type
type ImageHandler ¶
type ImageHandler struct{}
ImageHandler extracts metadata from image files
func (*ImageHandler) CanHandle ¶
func (h *ImageHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*ImageHandler) Extract ¶
func (h *ImageHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from an image file
func (*ImageHandler) SupportedExtensions ¶ added in v0.14.0
func (h *ImageHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports
type JSONHandler ¶
type JSONHandler struct{}
JSONHandler extracts metadata from JSON/YAML files
func (*JSONHandler) CanHandle ¶
func (h *JSONHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*JSONHandler) Extract ¶
func (h *JSONHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from a JSON/YAML file
func (*JSONHandler) SupportedExtensions ¶ added in v0.14.0
func (h *JSONHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports
type MarkdownHandler ¶
type MarkdownHandler struct{}
MarkdownHandler extracts metadata from Markdown files
func (*MarkdownHandler) CanHandle ¶
func (h *MarkdownHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*MarkdownHandler) Extract ¶
func (h *MarkdownHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from a Markdown file
func (*MarkdownHandler) SupportedExtensions ¶ added in v0.14.0
func (h *MarkdownHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports
type PDFHandler ¶
type PDFHandler struct{}
PDFHandler extracts metadata from PDF files
func (*PDFHandler) CanHandle ¶
func (h *PDFHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*PDFHandler) Extract ¶
func (h *PDFHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from a PDF file
func (*PDFHandler) SupportedExtensions ¶ added in v0.14.0
func (h *PDFHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports
type PptxHandler ¶
type PptxHandler struct{}
PptxHandler extracts metadata from PPTX files
func (*PptxHandler) CanHandle ¶
func (h *PptxHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*PptxHandler) Extract ¶
func (h *PptxHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from a PPTX file
func (*PptxHandler) ExtractText ¶
func (h *PptxHandler) ExtractText(path string) (string, error)
ExtractText extracts text content from all slides in a PPTX file
func (*PptxHandler) SupportedExtensions ¶ added in v0.14.0
func (h *PptxHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports
type VTTHandler ¶
type VTTHandler struct{}
VTTHandler extracts metadata from VTT transcript files
func (*VTTHandler) CanHandle ¶
func (h *VTTHandler) CanHandle(ext string) bool
CanHandle returns true if this handler can process the file
func (*VTTHandler) Extract ¶
func (h *VTTHandler) Extract(path string, info os.FileInfo) (*types.FileMetadata, error)
Extract extracts metadata from a VTT file
func (*VTTHandler) SupportedExtensions ¶ added in v0.14.0
func (h *VTTHandler) SupportedExtensions() []string
SupportedExtensions returns the list of extensions this handler supports