autocomplete

package
v0.0.0-...-80afc61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enquote

func Enquote(stringSet sets.String) sets.String

func FilterFuzzy

func FilterFuzzy(stringSet sets.String, prefix string, ignoreCase bool) sets.String

FilterFuzzy takes a set of strings and compares each string against the prefix and includes the string if the string contains the prefix in a subsequence, i.e. fuzzy searching for 'dog is equivalent to "*d*o*g*", which matches "Good food is gone".

func FilterPrefix

func FilterPrefix(stringSet sets.String, prefix string, ignoreCase bool) sets.String

a lot of this is lifted from "github.com/c-bata/go-prompt" but typed against sets.String since they are helpful in pruning a list of suggestions, given the filtering constraints. FilterPrefix takes a set of strings and compares each string against the prefix and includes the string if the string starts with that prefix.

Types

type Match

type Match interface {
	GetValue() string
	GetKind() string
	GetDetail() string
}

type PromQLCompleter

type PromQLCompleter interface {
	QueryIndex
	GenerateSuggestions(query string, pos int) []Match
}

type QueryIndex

type QueryIndex interface {
	GetMetricNames() sets.String
	GetStoredDimensionsForMetric(string) sets.String
	GetStoredValuesForMetricAndDimension(string, string) sets.String
}

in order to generate completion results, we require some store to implement an interface for retrieving metric names, their associated label keys and also their label values, since these values cannot be hardcoded but must be inferred at runtime.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL