Documentation
¶
Overview ¶
Package doctotext contains the docToText node: it extracts text from a document payload (pdf/docx/odt/pptx/txt) — the inverse of the `pdf` node. Output: msg.Payload = extracted text; Metadata["doc"] = {sourceFormat, mime}.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocToTextConfig ¶
type DocToTextConfig struct {
// Format: "auto" (default — detect from magic bytes) or a forced
// "pdf" | "docx" | "odt" | "pptx" | "txt".
Format string `json:"format"`
}
DocToTextConfig holds the `docToText` node configuration.
type DocToTextNode ¶
DocToTextNode extracts text from a document payload — the inverse of `pdf`.
func NewDocToTextNode ¶
func NewDocToTextNode(node nodestore.NodeInterface, cfg *DocToTextConfig) *DocToTextNode
NewDocToTextNode creates a new docToText node.
func (*DocToTextNode) Execute ¶
func (n *DocToTextNode) Execute(ctx context.Context, in nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute extracts the text and stamps the doc metadata.