func Refresh(refresh RefreshInterval) Option {
	return func(query *Query) {
		value := int64(refresh)
		query.Builder.Refresh = sdk.BoolInt{Flag: true, Value: &value}
	}
}
Refresh defines the interval in which the values will be refreshed.
package query
import (
	"github.com/grafana-tools/sdk"
)
type Option func(constant *Query)
type SortOrder int
const (
	None SortOrder = 0
	AlphabeticalAsc SortOrder = 1
	AlphabeticalDesc SortOrder = 2
	NumericalAsc SortOrder = 3
	NumericalDesc SortOrder = 4
	AlphabeticalNoCaseAsc SortOrder = 5
	AlphabeticalNoCaseDesc SortOrder = 6
)
type RefreshInterval int
const (
	Never = 0
	DashboardLoad = 1
	TimeChange = 2
)
type Query struct {
	Builder sdk.TemplateVar
}
func New(name string, options ...Option) *Query {
	query := &Query{Builder: sdk.TemplateVar{
		Name:  name,
		Label: name,
		Type:  "query",
	}}
	for _, opt := range append([]Option{Refresh(DashboardLoad)}, options...) {
		opt(query)
	}
	return query
}
func DataSource(source string) Option {
	return func(query *Query) {
		query.Builder.Datasource = &source
	}
}
func Request(request string) Option {
	return func(query *Query) {
		query.Builder.Query = request
	}
}
func Sort(order SortOrder) Option {
	return func(query *Query) {
		query.Builder.Sort = int(order)
	}
}