Documentation
¶
Overview ¶
Package opensearchinspect provides bounded, read-only OpenSearch metadata inspection.
Index ¶
Constants ¶
const ( DefaultMaxTargets = 2000 DefaultMaxFields = 20000 )
const ( ContainerObject = "object" ContainerNested = "nested" ContainerFlatObject = "flat_object" )
Container mapping types. A field's ancestor is reduced to one of these, or to the empty string when the field sits at the root of the document.
Variables ¶
This section is empty.
Functions ¶
func TimestampedPattern ¶ added in v0.1.29
TimestampedPattern reports the wildcard a rotated index rolls up into, and whether the name looked rotated at all.
Types ¶
type Field ¶
type Field struct {
Name string `json:"name"`
Types []string `json:"types"`
Searchable bool `json:"searchable"`
Aggregatable bool `json:"aggregatable"`
Conflicting bool `json:"conflicting,omitempty"`
Format string `json:"format,omitempty"`
// FormatConflicting reports that indices behind the target map this field
// with different date formats.
FormatConflicting bool `json:"formatConflicting,omitempty"`
// Container names the innermost object, nested or flat_object ancestor this
// field sits inside, and ContainerType is how that ancestor is mapped.
//
// They are carried down because the leaf alone cannot say how a selection on
// it behaves: `_field_caps` reports the key of a `nested` tag list and the key
// of a plain array of objects identically — both `keyword`, both searchable,
// both aggregatable — and the two need opposite treatment. Only the ancestor's
// own entry distinguishes them.
Container string `json:"container,omitempty"`
ContainerType string `json:"containerType,omitempty"`
}
func (Field) Nested ¶ added in v0.1.29
Nested reports that a selection on this field must be compiled inside a nested query to mean anything: OpenSearch indexes each element of a `nested` field as its own document, so a flat clause on `tags.key` matches no parent document at all — silently, with no error to read.
type FieldCatalog ¶
type FieldCatalog struct {
Target Target `json:"target"`
Fields []Field `json:"fields"`
Truncated bool `json:"truncated,omitempty"`
TruncateReason string `json:"truncateReason,omitempty"`
Cache *inspection.CacheMetadata `json:"cache,omitempty"`
}
type FieldRequest ¶ added in v0.1.29
FieldRequest selects one target and optionally narrows its field catalog.
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
func (*Inspector) Fields ¶
func (i *Inspector) Fields(ctx context.Context, request FieldRequest) (FieldCatalog, error)
func (*Inspector) Targets ¶
func (i *Inspector) Targets(ctx context.Context, request TargetRequest) (TargetCatalog, error)
type Target ¶
type Target struct {
Name string `json:"name"`
Kind string `json:"kind"`
Hidden bool `json:"hidden,omitempty"`
System bool `json:"system,omitempty"`
DataStream string `json:"dataStream,omitempty"`
// Pattern names the wildcard target a rotated index rolls up into.
Pattern string `json:"pattern,omitempty"`
// Count is how many rotations a `pattern` target covers.
Count int `json:"count,omitempty"`
Members []string `json:"members,omitempty"`
}
func RollupTargets ¶ added in v0.1.29
RollupTargets folds rotations of the same index into one wildcard target, so an author picks `jaeger-span-*` once instead of scrolling fifty-three daily indexes. A pattern is only synthesised for two or more rotations — a lone dated index is already its own best name — and data-stream backing indices are left alone, because the data stream already names them.
type TargetCatalog ¶
type TargetCatalog struct {
Targets []Target `json:"targets"`
Truncated bool `json:"truncated,omitempty"`
TruncateReason string `json:"truncateReason,omitempty"`
Cache *inspection.CacheMetadata `json:"cache,omitempty"`
}
type TargetRequest ¶ added in v0.1.29
type TargetRequest struct {
Refresh bool
}