Query🔗
Definition🔗
type Query struct {
// Grafana data source unique identifier; it should be '__expr__' for a Server Side Expression operation.
DatasourceUid *string `json:"datasourceUid,omitempty"`
// JSON is the raw JSON query and includes the above properties as well as custom properties.
Model cog/variants.Dataquery `json:"model,omitempty"`
// QueryType is an optional identifier for the type of query.
// It can be used to distinguish different types of queries.
QueryType *string `json:"queryType,omitempty"`
// RefID is the unique identifier of the query, set by the frontend call.
RefId *string `json:"refId,omitempty"`
// RelativeTimeRange is the per query start and end time
// for requests.
RelativeTimeRange *alerting.RelativeTimeRange `json:"relativeTimeRange,omitempty"`
}
Methods🔗
UnmarshalJSON🔗
UnmarshalJSON implements a custom JSON unmarshalling logic to decode Query
from JSON.
UnmarshalJSONStrict🔗
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode Query
from JSON.
Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …
Equals🔗
Equals tests the equality of two Query
objects.
Validate🔗
Validate checks all the validation constraints that may be defined on Query
fields for violations and returns them.