Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterFuzzy ¶
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 ¶
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 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.