mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-09 17:07:57 +08:00
Go: add context to lots of interface (#17253)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -34,6 +34,7 @@ package parser
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -60,7 +61,7 @@ func NewTextParser() *TextParser {
|
||||
// The items slice is always non-nil so downstream chunkers see a
|
||||
// non-empty JSON payload even for an empty input (mirrors the
|
||||
// MarkdownParser convention at markdown_parser.go:71-76).
|
||||
func (p *TextParser) ParseWithResult(filename string, data []byte) ParseResult {
|
||||
func (p *TextParser) ParseWithResult(ctx context.Context, filename string, data []byte) ParseResult {
|
||||
if !utf8Valid(data) {
|
||||
return ParseResult{Err: errInvalidUTF8}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user