query

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 1 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// Never will prevent the results from being refreshed.
	Never = 0

	// DashboardLoad will refresh the results every time the dashboard is loaded.
	DashboardLoad = 1

	// TimeChange will refresh the results every time the time interval changes.
	TimeChange = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(constant *Query)

Option represents an option that can be used to configure a query.

func DataSource

func DataSource(source string) Option

DataSource sets the data source to be used by the query.

func DefaultAll

func DefaultAll() Option

DefaultAll selects "All" values by default.

func Hide

func Hide() Option

Hide ensures that the variable will not be displayed.

func HideLabel

func HideLabel() Option

HideLabel ensures that this variable's label will not be displayed.

func IncludeAll

func IncludeAll() Option

IncludeAll adds an option to allow all values to be selected.

func Label

func Label(label string) Option

Label sets the label of the variable.

func Multi

func Multi() Option

Multi allows several values to be selected.

func Refresh

func Refresh(refresh RefreshInterval) Option

Refresh defines the interval in which the values will be refreshed.

func Regex

func Regex(regex string) Option

Regex defines a filter allowing to filter the values returned by the request/query.

func Request

func Request(request string) Option

Request defines the query to be executed.

func Sort

func Sort(order SortOrder) Option

Sort defines the order in which the values will be sorted.

type Query

type Query struct {
	Builder sdk.TemplateVar
}

Query represents a "query" templated variable.

func New

func New(name string, options ...Option) *Query

New creates a new "query" templated variable.

type RefreshInterval added in v0.2.0

type RefreshInterval int

RefreshInterval represents the interval at which the results of a query will be refreshed.

type SortOrder added in v0.2.0

type SortOrder int

SortOrder represents the ordering method applied to values.

const (
	// None will preserve the results ordering as returned by the query.
	None SortOrder = 0

	// AlphabeticalAsc will sort the results by ascending alphabetical order.
	AlphabeticalAsc SortOrder = 1

	// AlphabeticalDesc will sort the results by descending alphabetical order.
	AlphabeticalDesc SortOrder = 2

	// NumericalAsc will sort the results by ascending numerical order.
	NumericalAsc SortOrder = 3

	// NumericalDesc will sort the results by descending numerical order.
	NumericalDesc SortOrder = 4

	// AlphabeticalNoCaseAsc will sort the results by ascending alphabetical order, case-insensitive.
	AlphabeticalNoCaseAsc SortOrder = 5

	// AlphabeticalNoCaseDesc will sort the results by descending alphabetical order, case-insensitive.
	AlphabeticalNoCaseDesc SortOrder = 6
)

Jump to

Keyboard shortcuts

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