Documentation
¶
Index ¶
- func Count(objects []any) int
- func Head(objects []any, n int) []any
- func ListFields(objects []any) []string
- func Sample(objects []any, n int) []any
- func Tail(objects []any, n int) []any
- type FindOpts
- type FindResult
- type NumericStat
- type SchemaField
- type SchemaOpts
- type Stats
- type StringStat
- type TreeNode
- type TreeOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListFields ¶
ListFields returns a sorted list of all unique dot-paths.
Types ¶
type FindResult ¶
type FindResult struct {
Index int // object index
Path string // dot-path where found
Value string // the matching value
File string // source filename (if available)
}
FindResult represents a full-text search match.
type NumericStat ¶
NumericStat holds numeric field statistics.
type SchemaField ¶
type SchemaField struct {
Path string // e.g. ".error.message"
Types []string // e.g. ["string", "null"]
Frequency float64 // 0.0 to 1.0
Examples []any // sample values
Unique int // count of unique values (approx for large sets)
}
SchemaField represents one field in the inferred schema.
func InferSchema ¶
func InferSchema(objects []any, opts SchemaOpts) []SchemaField
InferSchema walks all objects and collects field paths with types and frequencies.
type SchemaOpts ¶
type SchemaOpts struct {
MaxExamples int
}
SchemaOpts configures schema inference.
type Stats ¶
type Stats struct {
Count int
SchemaCount int // distinct shapes
Fields int // unique field paths
NumericStats map[string]NumericStat
StringStats map[string]StringStat
NullCounts map[string]int
}
Stats represents statistical summary.
func ComputeStats ¶
ComputeStats computes statistical summary of objects.
type StringStat ¶
StringStat holds string field statistics.
Click to show internal directories.
Click to hide internal directories.