Documentation
¶
Index ¶
- func ConvertToPDF(base64Encoded, fileExtension string) (string, error)
- func Init(bc base.Component) *component
- type ConvertDocumentToMarkdownInput
- type ConvertDocumentToMarkdownOutput
- type ConvertPDFToImagesInput
- type ConvertPDFToImagesOutput
- type ConvertToTextInput
- type ConvertToTextOutput
- type DocxDocToMarkdownTransformer
- type HTMLToMarkdownTransformer
- type MarkdownTransformer
- type MarkdownTransformerGetterFunc
- type PDFToMarkdownTransformer
- type PptPptxToMarkdownTransformer
- type XlsxToMarkdownTransformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToPDF ¶
Types ¶
type ConvertDocumentToMarkdownOutput ¶
type ConvertDocumentToMarkdownOutput struct {
Body string `json:"body"`
Filename string `json:"filename"`
Images []string `json:"images,omitempty"`
}
func ConvertDocumentToMarkdown ¶
func ConvertDocumentToMarkdown(inputStruct *ConvertDocumentToMarkdownInput, transformerGetter MarkdownTransformerGetterFunc) (*ConvertDocumentToMarkdownOutput, error)
type ConvertPDFToImagesInput ¶
type ConvertPDFToImagesOutput ¶
type ConvertPDFToImagesOutput struct {
Images []string `json:"images"`
Filenames []string `json:"filenames"`
}
func ConvertPDFToImage ¶
func ConvertPDFToImage(inputStruct *ConvertPDFToImagesInput) (*ConvertPDFToImagesOutput, error)
type ConvertToTextInput ¶
type ConvertToTextInput struct {
// Document: Document to convert
Document string `json:"document"`
Filename string `json:"filename"`
}
ConvertToTextInput defines the input for convert to text task
type ConvertToTextOutput ¶
type ConvertToTextOutput struct {
// Body: Plain text converted from the document
Body string `json:"body"`
// Meta: Metadata extracted from the document
Meta map[string]string `json:"meta"`
// MSecs: Time taken to convert the document
MSecs uint32 `json:"msecs"`
// Error: Error message if any during the conversion process
Error string `json:"error"`
Filename string `json:"filename"`
}
ConvertToTextOutput defines the output for convert to text task
func ConvertToText ¶
func ConvertToText(input ConvertToTextInput) (ConvertToTextOutput, error)
type DocxDocToMarkdownTransformer ¶
type DocxDocToMarkdownTransformer struct {
Base64EncodedText string
FileExtension string
DisplayImageTag bool
PDFConvertFunc func(string, bool) (converterOutput, error)
}
func (DocxDocToMarkdownTransformer) Transform ¶
func (t DocxDocToMarkdownTransformer) Transform() (converterOutput, error)
type HTMLToMarkdownTransformer ¶
type HTMLToMarkdownTransformer struct {
Base64EncodedText string
FileExtension string
DisplayImageTag bool
}
func (HTMLToMarkdownTransformer) Transform ¶
func (t HTMLToMarkdownTransformer) Transform() (converterOutput, error)
type MarkdownTransformer ¶
type MarkdownTransformer interface {
Transform() (converterOutput, error)
}
func GetMarkdownTransformer ¶
func GetMarkdownTransformer(fileExtension string, inputStruct *ConvertDocumentToMarkdownInput) (MarkdownTransformer, error)
type MarkdownTransformerGetterFunc ¶
type MarkdownTransformerGetterFunc func(fileExtension string, inputStruct *ConvertDocumentToMarkdownInput) (MarkdownTransformer, error)
type PDFToMarkdownTransformer ¶
type PDFToMarkdownTransformer struct {
Base64EncodedText string
FileExtension string
DisplayImageTag bool
PDFConvertFunc func(string, bool) (converterOutput, error)
}
func (PDFToMarkdownTransformer) Transform ¶
func (t PDFToMarkdownTransformer) Transform() (converterOutput, error)
type PptPptxToMarkdownTransformer ¶
type PptPptxToMarkdownTransformer struct {
Base64EncodedText string
FileExtension string
DisplayImageTag bool
PDFConvertFunc func(string, bool) (converterOutput, error)
}
func (PptPptxToMarkdownTransformer) Transform ¶
func (t PptPptxToMarkdownTransformer) Transform() (converterOutput, error)
type XlsxToMarkdownTransformer ¶
type XlsxToMarkdownTransformer struct {
Base64EncodedText string
}
func (XlsxToMarkdownTransformer) Transform ¶
func (t XlsxToMarkdownTransformer) Transform() (converterOutput, error)
Click to show internal directories.
Click to hide internal directories.