ingest documents

This commit is contained in:
venture
2026-11-16 11:03:48 +01:00
parent cc0ddd0dfb
commit 7b3f20b8d7
15 changed files with 1148 additions and 2 deletions
+9
View File
@@ -3,6 +3,7 @@ package document
import (
"context"
"database/sql"
"encoding/json"
"errors"
"fmt"
"strings"
@@ -136,6 +137,14 @@ func metadataValue(metadata string) string {
return metadata
}
func normalizeMetadata(metadata string) (string, error) {
value := metadataValue(metadata)
if !json.Valid([]byte(value)) {
return "", ErrInvalidMetadata
}
return value, nil
}
func aclInheritValue(value *bool) int64 {
if value == nil || *value {
return 1