Skip to content

QueryBuilder🔗

Constructor🔗

func NewQueryBuilder(refId string) *QueryBuilder

Methods🔗

Build🔗

Builds the object.

func (builder *QueryBuilder) Build() (Query, error)

DatasourceUid🔗

Grafana data source unique identifier; it should be 'expr' for a Server Side Expression operation.

func (builder *QueryBuilder) DatasourceUid(datasourceUid string) *QueryBuilder

Model🔗

JSON is the raw JSON query and includes the above properties as well as custom properties.

func (builder *QueryBuilder) Model(model cog.Builder[cog/variants.Dataquery]) *QueryBuilder

QueryType🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

func (builder *QueryBuilder) QueryType(queryType string) *QueryBuilder

RefId🔗

RefID is the unique identifier of the query, set by the frontend call.

func (builder *QueryBuilder) RefId(refId string) *QueryBuilder

RelativeTimeRange🔗

RelativeTimeRange is the per query start and end time

for requests.

func (builder *QueryBuilder) RelativeTimeRange(from alerting.Duration, to alerting.Duration) *QueryBuilder

See also🔗