diff --git a/pkg/dash/dash.go b/pkg/dash/dash.go index 222179eee473d..74f38d867513e 100644 --- a/pkg/dash/dash.go +++ b/pkg/dash/dash.go @@ -18,7 +18,7 @@ import ( prom "github.com/prometheus/client_golang/prometheus" ) -var requiredLabels = []string{"cluster", "namespace", "container"} +var requiredLabels = []string{"cluster", "namespace", "container", "fake"} type DashboardLoader struct { ml DependencyLoader @@ -120,15 +120,7 @@ func (l *DashboardLoader) writesDashboard() (dashboard.Dashboard, error) { Tags([]string{"generated", "from", "go"}). Refresh("1m"). Time("now-30m", "now"). - Timezone(common.TimeZoneUtc). - WithVariable( - dashboard.NewDatasourceVariableBuilder("prometheus_datasource"). - Label("Prometheus datasource"). - Type("prometheus").Current(dashboard.VariableOption{ - Text: dashboard.StringOrArrayOfString{String: cog.ToPtr("default")}, - Value: dashboard.StringOrArrayOfString{String: cog.ToPtr("default")}, - }), - ) + Timezone(common.TimeZoneUtc) l.WelcomeRow(objectStorage, builder) @@ -206,10 +198,6 @@ func (l *DashboardLoader) WelcomeRow(objectStorage *ObjectStorageMetrics, builde Span(8). Title("Missing required labels"). Description("Required labels not present on Loki instances"). - Datasource(dashboard.DataSourceRef{ - Type: cog.ToPtr("prometheus"), - Uid: cog.ToPtr("$prometheus_datasource"), - }). Targets(targets).Legend( common.NewVizLegendOptionsBuilder(). IsVisible(true). @@ -377,10 +365,6 @@ func (b *RedMethodBuilder) QPSPanel() (*timeseries.PanelBuilder, error) { Span(8). Min(0). Unit("short"). - Datasource(dashboard.DataSourceRef{ - Type: cog.ToPtr("prometheus"), - Uid: cog.ToPtr("$prometheus_datasource"), - }). WithTarget(qry). Legend( common.NewVizLegendOptionsBuilder().ShowLegend(true).DisplayMode(common.LegendDisplayModeList).Placement(common.LegendPlacementBottom), @@ -436,10 +420,6 @@ func (b *RedMethodBuilder) LatencyPanels() (res []cog.Builder[dashboard.Panel], Span(8). Unit("ms"). Min(0). - Datasource(dashboard.DataSourceRef{ - Type: cog.ToPtr("prometheus"), - Uid: cog.ToPtr("$prometheus_datasource"), - }). Legend( common.NewVizLegendOptionsBuilder().ShowLegend(true).DisplayMode(common.LegendDisplayModeList).Placement(common.LegendPlacementBottom), ). diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/table/panel_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/table/panel_builder_gen.go deleted file mode 100644 index e526f3bdb61a5..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/table/panel_builder_gen.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package table - -import ( - "errors" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" - variants "github.com/grafana/grafana-foundation-sdk/go/cog/variants" - common "github.com/grafana/grafana-foundation-sdk/go/common" - dashboard "github.com/grafana/grafana-foundation-sdk/go/dashboard" -) - -var _ cog.Builder[dashboard.Panel] = (*PanelBuilder)(nil) - -// Dashboard panels are the basic visualization building blocks. -type PanelBuilder struct { - internal *dashboard.Panel - errors map[string]cog.BuildErrors -} - -func NewPanelBuilder() *PanelBuilder { - resource := &dashboard.Panel{} - builder := &PanelBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - builder.internal.Type = "table" - - return builder -} - -func (builder *PanelBuilder) Build() (dashboard.Panel, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("Panel", err)...) - } - - if len(errs) != 0 { - return dashboard.Panel{}, errs - } - - return *builder.internal, nil -} - -// Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally. -func (builder *PanelBuilder) Id(id uint32) *PanelBuilder { - builder.internal.Id = &id - - return builder -} - -// Depends on the panel plugin. See the plugin documentation for details. -func (builder *PanelBuilder) Targets(targets []cog.Builder[variants.Dataquery]) *PanelBuilder { - targetsResources := make([]variants.Dataquery, 0, len(targets)) - for _, r1 := range targets { - targetsDepth1, err := r1.Build() - if err != nil { - builder.errors["targets"] = err.(cog.BuildErrors) - return builder - } - targetsResources = append(targetsResources, targetsDepth1) - } - builder.internal.Targets = targetsResources - - return builder -} - -// Depends on the panel plugin. See the plugin documentation for details. -func (builder *PanelBuilder) WithTarget(targets cog.Builder[variants.Dataquery]) *PanelBuilder { - targetsResource, err := targets.Build() - if err != nil { - builder.errors["targets"] = err.(cog.BuildErrors) - return builder - } - builder.internal.Targets = append(builder.internal.Targets, targetsResource) - - return builder -} - -// Panel title. -func (builder *PanelBuilder) Title(title string) *PanelBuilder { - builder.internal.Title = &title - - return builder -} - -// Panel description. -func (builder *PanelBuilder) Description(description string) *PanelBuilder { - builder.internal.Description = &description - - return builder -} - -// Whether to display the panel without a background. -func (builder *PanelBuilder) Transparent(transparent bool) *PanelBuilder { - builder.internal.Transparent = &transparent - - return builder -} - -// The datasource used in all targets. -func (builder *PanelBuilder) Datasource(datasource dashboard.DataSourceRef) *PanelBuilder { - builder.internal.Datasource = &datasource - - return builder -} - -// Grid position. -func (builder *PanelBuilder) GridPos(gridPos dashboard.GridPos) *PanelBuilder { - builder.internal.GridPos = &gridPos - - return builder -} - -// Panel height. The height is the number of rows from the top edge of the panel. -func (builder *PanelBuilder) Height(h uint32) *PanelBuilder { - if !(h > 0) { - builder.errors["h"] = cog.MakeBuildErrors("h", errors.New("h must be > 0")) - return builder - } - if builder.internal.GridPos == nil { - builder.internal.GridPos = &dashboard.GridPos{} - } - builder.internal.GridPos.H = h - - return builder -} - -// Panel width. The width is the number of columns from the left edge of the panel. -func (builder *PanelBuilder) Span(w uint32) *PanelBuilder { - if !(w > 0) { - builder.errors["w"] = cog.MakeBuildErrors("w", errors.New("w must be > 0")) - return builder - } - if !(w <= 24) { - builder.errors["w"] = cog.MakeBuildErrors("w", errors.New("w must be <= 24")) - return builder - } - if builder.internal.GridPos == nil { - builder.internal.GridPos = &dashboard.GridPos{} - } - builder.internal.GridPos.W = w - - return builder -} - -// Panel links. -func (builder *PanelBuilder) Links(links []cog.Builder[dashboard.DashboardLink]) *PanelBuilder { - linksResources := make([]dashboard.DashboardLink, 0, len(links)) - for _, r1 := range links { - linksDepth1, err := r1.Build() - if err != nil { - builder.errors["links"] = err.(cog.BuildErrors) - return builder - } - linksResources = append(linksResources, linksDepth1) - } - builder.internal.Links = linksResources - - return builder -} - -// Name of template variable to repeat for. -func (builder *PanelBuilder) Repeat(repeat string) *PanelBuilder { - builder.internal.Repeat = &repeat - - return builder -} - -// Direction to repeat in if 'repeat' is set. -// `h` for horizontal, `v` for vertical. -func (builder *PanelBuilder) RepeatDirection(repeatDirection dashboard.PanelRepeatDirection) *PanelBuilder { - builder.internal.RepeatDirection = &repeatDirection - - return builder -} - -// Option for repeated panels that controls max items per row -// Only relevant for horizontally repeated panels -func (builder *PanelBuilder) MaxPerRow(maxPerRow float64) *PanelBuilder { - builder.internal.MaxPerRow = &maxPerRow - - return builder -} - -// The maximum number of data points that the panel queries are retrieving. -func (builder *PanelBuilder) MaxDataPoints(maxDataPoints float64) *PanelBuilder { - builder.internal.MaxDataPoints = &maxDataPoints - - return builder -} - -// List of transformations that are applied to the panel data before rendering. -// When there are multiple transformations, Grafana applies them in the order they are listed. -// Each transformation creates a result set that then passes on to the next transformation in the processing pipeline. -func (builder *PanelBuilder) Transformations(transformations []dashboard.DataTransformerConfig) *PanelBuilder { - builder.internal.Transformations = transformations - - return builder -} - -// List of transformations that are applied to the panel data before rendering. -// When there are multiple transformations, Grafana applies them in the order they are listed. -// Each transformation creates a result set that then passes on to the next transformation in the processing pipeline. -func (builder *PanelBuilder) WithTransformation(transformations dashboard.DataTransformerConfig) *PanelBuilder { - builder.internal.Transformations = append(builder.internal.Transformations, transformations) - - return builder -} - -// The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables. -// This value must be formatted as a number followed by a valid time -// identifier like: "40s", "3d", etc. -// See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options -func (builder *PanelBuilder) Interval(interval string) *PanelBuilder { - builder.internal.Interval = &interval - - return builder -} - -// Overrides the relative time range for individual panels, -// which causes them to be different than what is selected in -// the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different -// time periods or days on the same dashboard. -// The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far), -// `now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years). -// Note: Panel time overrides have no effect when the dashboard’s time range is absolute. -// See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options -func (builder *PanelBuilder) TimeFrom(timeFrom string) *PanelBuilder { - builder.internal.TimeFrom = &timeFrom - - return builder -} - -// Overrides the time range for individual panels by shifting its start and end relative to the time picker. -// For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`. -// Note: Panel time overrides have no effect when the dashboard’s time range is absolute. -// See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options -func (builder *PanelBuilder) TimeShift(timeShift string) *PanelBuilder { - builder.internal.TimeShift = &timeShift - - return builder -} - -// Controls if the timeFrom or timeShift overrides are shown in the panel header -func (builder *PanelBuilder) HideTimeOverride(hideTimeOverride bool) *PanelBuilder { - builder.internal.HideTimeOverride = &hideTimeOverride - - return builder -} - -// Dynamically load the panel -func (builder *PanelBuilder) LibraryPanel(libraryPanel dashboard.LibraryPanelRef) *PanelBuilder { - builder.internal.LibraryPanel = &libraryPanel - - return builder -} - -// Sets panel queries cache timeout. -func (builder *PanelBuilder) CacheTimeout(cacheTimeout string) *PanelBuilder { - builder.internal.CacheTimeout = &cacheTimeout - - return builder -} - -// Overrides the data source configured time-to-live for a query cache item in milliseconds -func (builder *PanelBuilder) QueryCachingTTL(queryCachingTTL float64) *PanelBuilder { - builder.internal.QueryCachingTTL = &queryCachingTTL - - return builder -} - -// The display value for this field. This supports template variables blank is auto -func (builder *PanelBuilder) DisplayName(displayName string) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Defaults.DisplayName = &displayName - - return builder -} - -// Unit a field should use. The unit you select is applied to all fields except time. -// You can use the units ID availables in Grafana or a custom unit. -// Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts -// As custom unit, you can use the following formats: -// `suffix:` for custom unit that should go after value. -// `prefix:` for custom unit that should go before value. -// `time:` For custom date time formats type for example `time:YYYY-MM-DD`. -// `si:` for custom SI units. For example: `si: mF`. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character. -// `count:` for a custom count unit. -// `currency:` for custom a currency unit. -func (builder *PanelBuilder) Unit(unit string) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Defaults.Unit = &unit - - return builder -} - -// Specify the number of decimals Grafana includes in the rendered value. -// If you leave this field blank, Grafana automatically truncates the number of decimals based on the value. -// For example 1.1234 will display as 1.12 and 100.456 will display as 100. -// To display all decimals, set the unit to `String`. -func (builder *PanelBuilder) Decimals(decimals float64) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Defaults.Decimals = &decimals - - return builder -} - -// The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields. -func (builder *PanelBuilder) Min(min float64) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Defaults.Min = &min - - return builder -} - -// The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields. -func (builder *PanelBuilder) Max(max float64) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Defaults.Max = &max - - return builder -} - -// Convert input values into a display string -func (builder *PanelBuilder) Mappings(mappings []dashboard.ValueMapping) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Defaults.Mappings = mappings - - return builder -} - -// Map numeric values to states -func (builder *PanelBuilder) Thresholds(thresholds cog.Builder[dashboard.ThresholdsConfig]) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - thresholdsResource, err := thresholds.Build() - if err != nil { - builder.errors["fieldConfig.defaults.thresholds"] = err.(cog.BuildErrors) - return builder - } - builder.internal.FieldConfig.Defaults.Thresholds = &thresholdsResource - - return builder -} - -// Panel color configuration -func (builder *PanelBuilder) ColorScheme(color cog.Builder[dashboard.FieldColor]) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - colorResource, err := color.Build() - if err != nil { - builder.errors["fieldConfig.defaults.color"] = err.(cog.BuildErrors) - return builder - } - builder.internal.FieldConfig.Defaults.Color = &colorResource - - return builder -} - -// Alternative to empty string -func (builder *PanelBuilder) NoValue(noValue string) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Defaults.NoValue = &noValue - - return builder -} - -// Overrides are the options applied to specific fields overriding the defaults. -func (builder *PanelBuilder) Overrides(overrides []cog.Builder[dashboard.DashboardFieldConfigSourceOverrides]) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - overridesResources := make([]dashboard.DashboardFieldConfigSourceOverrides, 0, len(overrides)) - for _, r1 := range overrides { - overridesDepth1, err := r1.Build() - if err != nil { - builder.errors["fieldConfig.overrides"] = err.(cog.BuildErrors) - return builder - } - overridesResources = append(overridesResources, overridesDepth1) - } - builder.internal.FieldConfig.Overrides = overridesResources - - return builder -} - -// Overrides are the options applied to specific fields overriding the defaults. -func (builder *PanelBuilder) WithOverride(matcher dashboard.MatcherConfig, properties []dashboard.DynamicConfigValue) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - builder.internal.FieldConfig.Overrides = append(builder.internal.FieldConfig.Overrides, dashboard.DashboardFieldConfigSourceOverrides{ - Matcher: matcher, - Properties: properties, - }) - - return builder -} - -// Represents the index of the selected frame -func (builder *PanelBuilder) FrameIndex(frameIndex float64) *PanelBuilder { - if builder.internal.Options == nil { - builder.internal.Options = &Options{} - } - builder.internal.Options.(*Options).FrameIndex = frameIndex - - return builder -} - -// Controls whether the panel should show the header -func (builder *PanelBuilder) ShowHeader(showHeader bool) *PanelBuilder { - if builder.internal.Options == nil { - builder.internal.Options = &Options{} - } - builder.internal.Options.(*Options).ShowHeader = showHeader - - return builder -} - -// Controls whether the header should show icons for the column types -func (builder *PanelBuilder) ShowTypeIcons(showTypeIcons bool) *PanelBuilder { - if builder.internal.Options == nil { - builder.internal.Options = &Options{} - } - builder.internal.Options.(*Options).ShowTypeIcons = &showTypeIcons - - return builder -} - -// Used to control row sorting -func (builder *PanelBuilder) SortBy(sortBy []cog.Builder[common.TableSortByFieldState]) *PanelBuilder { - if builder.internal.Options == nil { - builder.internal.Options = &Options{} - } - sortByResources := make([]common.TableSortByFieldState, 0, len(sortBy)) - for _, r1 := range sortBy { - sortByDepth1, err := r1.Build() - if err != nil { - builder.errors["options.sortBy"] = err.(cog.BuildErrors) - return builder - } - sortByResources = append(sortByResources, sortByDepth1) - } - builder.internal.Options.(*Options).SortBy = sortByResources - - return builder -} - -// Controls footer options -func (builder *PanelBuilder) Footer(footer cog.Builder[common.TableFooterOptions]) *PanelBuilder { - if builder.internal.Options == nil { - builder.internal.Options = &Options{} - } - footerResource, err := footer.Build() - if err != nil { - builder.errors["options.footer"] = err.(cog.BuildErrors) - return builder - } - builder.internal.Options.(*Options).Footer = &footerResource - - return builder -} - -// Controls the height of the rows -func (builder *PanelBuilder) CellHeight(cellHeight common.TableCellHeight) *PanelBuilder { - if builder.internal.Options == nil { - builder.internal.Options = &Options{} - } - builder.internal.Options.(*Options).CellHeight = &cellHeight - - return builder -} - -func (builder *PanelBuilder) Width(width float64) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).Width = &width - - return builder -} - -func (builder *PanelBuilder) MinWidth(minWidth float64) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).MinWidth = &minWidth - - return builder -} - -func (builder *PanelBuilder) Align(align common.FieldTextAlignment) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).Align = align - - return builder -} - -// This field is deprecated in favor of using cellOptions -func (builder *PanelBuilder) DisplayMode(displayMode common.TableCellDisplayMode) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).DisplayMode = &displayMode - - return builder -} - -func (builder *PanelBuilder) CellOptions(cellOptions common.TableCellOptions) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).CellOptions = &cellOptions - - return builder -} - -// ?? default is missing or false ?? -func (builder *PanelBuilder) Hidden(hidden bool) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).Hidden = &hidden - - return builder -} - -func (builder *PanelBuilder) Inspect(inspect bool) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).Inspect = inspect - - return builder -} - -func (builder *PanelBuilder) Filterable(filterable bool) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).Filterable = &filterable - - return builder -} - -// Hides any header for a column, useful for columns that show some static content or buttons. -func (builder *PanelBuilder) HideHeader(hideHeader bool) *PanelBuilder { - if builder.internal.FieldConfig == nil { - builder.internal.FieldConfig = &dashboard.FieldConfigSource{} - } - if builder.internal.FieldConfig.Defaults.Custom == nil { - builder.internal.FieldConfig.Defaults.Custom = &FieldConfig{} - } - builder.internal.FieldConfig.Defaults.Custom.(*FieldConfig).HideHeader = &hideHeader - - return builder -} - -func (builder *PanelBuilder) applyDefaults() { - builder.Transparent(false) - builder.Height(9) - builder.Span(12) - builder.FrameIndex(0) - builder.ShowHeader(true) - builder.ShowTypeIcons(false) - builder.Footer(common.NewTableFooterOptionsBuilder(). - CountRows(false). - Reducer([]string{}). - Show(false), - ) - builder.CellHeight("sm") - builder.Align("auto") - builder.Inspect(false) -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/table/panel_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/table/panel_converter_gen.go deleted file mode 100644 index e6b1edf62f45f..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/table/panel_converter_gen.go +++ /dev/null @@ -1,637 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package table - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" - common "github.com/grafana/grafana-foundation-sdk/go/common" - dashboard "github.com/grafana/grafana-foundation-sdk/go/dashboard" -) - -func PanelConverter(input dashboard.Panel) string { - calls := []string{ - `table.NewPanelBuilder()`, - } - var buffer strings.Builder - if input.Id != nil { - - buffer.WriteString(`Id(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Id)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Targets != nil && len(input.Targets) >= 1 { - - buffer.WriteString(`Targets(`) - tmparg0 := []string{} - for _, arg1 := range input.Targets { - tmptargetsarg1 := cog.ConvertDataqueryToCode(arg1) - tmparg0 = append(tmparg0, tmptargetsarg1) - } - arg0 := "[]cog.Builder[variants.Dataquery]{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Title != nil && *input.Title != "" { - - buffer.WriteString(`Title(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Title)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Description != nil && *input.Description != "" { - - buffer.WriteString(`Description(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Description)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Transparent != nil && *input.Transparent != false { - - buffer.WriteString(`Transparent(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Transparent)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Datasource != nil { - - buffer.WriteString(`Datasource(`) - arg0 := cog.Dump(*input.Datasource) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.GridPos != nil { - - buffer.WriteString(`GridPos(`) - arg0 := cog.Dump(*input.GridPos) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.GridPos != nil && input.GridPos.H != 9 { - - buffer.WriteString(`Height(`) - arg0 := fmt.Sprintf("%#v", input.GridPos.H) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.GridPos != nil && input.GridPos.W != 12 { - - buffer.WriteString(`Span(`) - arg0 := fmt.Sprintf("%#v", input.GridPos.W) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Links != nil && len(input.Links) >= 1 { - - buffer.WriteString(`Links(`) - tmparg0 := []string{} - for _, arg1 := range input.Links { - tmplinksarg1 := dashboard.DashboardLinkConverter(arg1) - tmparg0 = append(tmparg0, tmplinksarg1) - } - arg0 := "[]cog.Builder[dashboard.DashboardLink]{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Repeat != nil && *input.Repeat != "" { - - buffer.WriteString(`Repeat(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Repeat)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.RepeatDirection != nil { - - buffer.WriteString(`RepeatDirection(`) - arg0 := cog.Dump(*input.RepeatDirection) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.MaxPerRow != nil { - - buffer.WriteString(`MaxPerRow(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.MaxPerRow)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.MaxDataPoints != nil { - - buffer.WriteString(`MaxDataPoints(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.MaxDataPoints)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Transformations != nil && len(input.Transformations) >= 1 { - - buffer.WriteString(`Transformations(`) - tmparg0 := []string{} - for _, arg1 := range input.Transformations { - tmptransformationsarg1 := cog.Dump(arg1) - tmparg0 = append(tmparg0, tmptransformationsarg1) - } - arg0 := "[]dashboard.DataTransformerConfig{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Interval != nil && *input.Interval != "" { - - buffer.WriteString(`Interval(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Interval)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.TimeFrom != nil && *input.TimeFrom != "" { - - buffer.WriteString(`TimeFrom(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.TimeFrom)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.TimeShift != nil && *input.TimeShift != "" { - - buffer.WriteString(`TimeShift(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.TimeShift)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.HideTimeOverride != nil { - - buffer.WriteString(`HideTimeOverride(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.HideTimeOverride)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.LibraryPanel != nil { - - buffer.WriteString(`LibraryPanel(`) - arg0 := cog.Dump(*input.LibraryPanel) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.CacheTimeout != nil && *input.CacheTimeout != "" { - - buffer.WriteString(`CacheTimeout(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.CacheTimeout)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.QueryCachingTTL != nil { - - buffer.WriteString(`QueryCachingTTL(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.QueryCachingTTL)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.DisplayName != nil && *input.FieldConfig.Defaults.DisplayName != "" { - - buffer.WriteString(`DisplayName(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.DisplayName)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Unit != nil && *input.FieldConfig.Defaults.Unit != "" { - - buffer.WriteString(`Unit(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Unit)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Decimals != nil { - - buffer.WriteString(`Decimals(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Decimals)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Min != nil { - - buffer.WriteString(`Min(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Min)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Max != nil { - - buffer.WriteString(`Max(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Max)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Mappings != nil && len(input.FieldConfig.Defaults.Mappings) >= 1 { - - buffer.WriteString(`Mappings(`) - tmparg0 := []string{} - for _, arg1 := range input.FieldConfig.Defaults.Mappings { - tmpmappingsarg1 := cog.Dump(arg1) - tmparg0 = append(tmparg0, tmpmappingsarg1) - } - arg0 := "[]dashboard.ValueMapping{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Thresholds != nil { - - buffer.WriteString(`Thresholds(`) - arg0 := dashboard.ThresholdsConfigConverter(*input.FieldConfig.Defaults.Thresholds) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Color != nil { - - buffer.WriteString(`ColorScheme(`) - arg0 := dashboard.FieldColorConverter(*input.FieldConfig.Defaults.Color) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.NoValue != nil && *input.FieldConfig.Defaults.NoValue != "" { - - buffer.WriteString(`NoValue(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.NoValue)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Overrides != nil && len(input.FieldConfig.Overrides) >= 1 { - - buffer.WriteString(`Overrides(`) - tmparg0 := []string{} - for _, arg1 := range input.FieldConfig.Overrides { - tmpoverridesarg1 := dashboard.DashboardFieldConfigSourceOverridesConverter(arg1) - tmparg0 = append(tmparg0, tmpoverridesarg1) - } - arg0 := "[]cog.Builder[dashboard.DashboardFieldConfigSourceOverrides]{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Overrides != nil && len(input.FieldConfig.Overrides) >= 1 { - for _, item := range input.FieldConfig.Overrides { - - buffer.WriteString(`WithOverride(`) - arg0 := cog.Dump(item.Matcher) - buffer.WriteString(arg0) - buffer.WriteString(", ") - tmparg1 := []string{} - for _, arg1 := range item.Properties { - tmppropertiesarg1 := cog.Dump(arg1) - tmparg1 = append(tmparg1, tmppropertiesarg1) - } - arg1 := "[]dashboard.DynamicConfigValue{" + strings.Join(tmparg1, ",\n") + "}" - buffer.WriteString(arg1) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - } - if input.Options != nil && input.Options.(*Options).FrameIndex != 0 { - - buffer.WriteString(`FrameIndex(`) - arg0 := fmt.Sprintf("%#v", input.Options.(*Options).FrameIndex) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Options != nil && input.Options.(*Options).ShowHeader != true { - - buffer.WriteString(`ShowHeader(`) - arg0 := fmt.Sprintf("%#v", input.Options.(*Options).ShowHeader) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Options != nil && input.Options.(*Options).ShowTypeIcons != nil && *input.Options.(*Options).ShowTypeIcons != false { - - buffer.WriteString(`ShowTypeIcons(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Options.(*Options).ShowTypeIcons)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Options != nil && input.Options.(*Options).SortBy != nil && len(input.Options.(*Options).SortBy) >= 1 { - - buffer.WriteString(`SortBy(`) - tmparg0 := []string{} - for _, arg1 := range input.Options.(*Options).SortBy { - tmpsortByarg1 := common.TableSortByFieldStateConverter(arg1) - tmparg0 = append(tmparg0, tmpsortByarg1) - } - arg0 := "[]cog.Builder[common.TableSortByFieldState]{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Options != nil && input.Options.(*Options).Footer != nil { - - buffer.WriteString(`Footer(`) - arg0 := common.TableFooterOptionsConverter(*input.Options.(*Options).Footer) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Options != nil && input.Options.(*Options).CellHeight != nil { - - buffer.WriteString(`CellHeight(`) - arg0 := cog.Dump(*input.Options.(*Options).CellHeight) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).Width != nil { - - buffer.WriteString(`Width(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Custom.(*FieldConfig).Width)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).MinWidth != nil { - - buffer.WriteString(`MinWidth(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Custom.(*FieldConfig).MinWidth)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil { - - buffer.WriteString(`Align(`) - arg0 := cog.Dump(input.FieldConfig.Defaults.Custom.(*FieldConfig).Align) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).DisplayMode != nil { - - buffer.WriteString(`DisplayMode(`) - arg0 := cog.Dump(*input.FieldConfig.Defaults.Custom.(*FieldConfig).DisplayMode) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).CellOptions != nil { - - buffer.WriteString(`CellOptions(`) - arg0 := cog.Dump(*input.FieldConfig.Defaults.Custom.(*FieldConfig).CellOptions) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).Hidden != nil { - - buffer.WriteString(`Hidden(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Custom.(*FieldConfig).Hidden)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).Inspect != false { - - buffer.WriteString(`Inspect(`) - arg0 := fmt.Sprintf("%#v", input.FieldConfig.Defaults.Custom.(*FieldConfig).Inspect) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).Filterable != nil { - - buffer.WriteString(`Filterable(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Custom.(*FieldConfig).Filterable)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FieldConfig != nil && input.FieldConfig.Defaults.Custom != nil && input.FieldConfig.Defaults.Custom.(*FieldConfig).HideHeader != nil { - - buffer.WriteString(`HideHeader(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FieldConfig.Defaults.Custom.(*FieldConfig).HideHeader)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/table/types_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/table/types_gen.go deleted file mode 100644 index 3d79d75a7144a..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/table/types_gen.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package table - -import ( - "encoding/json" - - variants "github.com/grafana/grafana-foundation-sdk/go/cog/variants" - common "github.com/grafana/grafana-foundation-sdk/go/common" - dashboard "github.com/grafana/grafana-foundation-sdk/go/dashboard" -) - -type Options struct { - // Represents the index of the selected frame - FrameIndex float64 `json:"frameIndex"` - // Controls whether the panel should show the header - ShowHeader bool `json:"showHeader"` - // Controls whether the header should show icons for the column types - ShowTypeIcons *bool `json:"showTypeIcons,omitempty"` - // Used to control row sorting - SortBy []common.TableSortByFieldState `json:"sortBy,omitempty"` - // Controls footer options - Footer *common.TableFooterOptions `json:"footer,omitempty"` - // Controls the height of the rows - CellHeight *common.TableCellHeight `json:"cellHeight,omitempty"` -} - -func (resource Options) Equals(other Options) bool { - if resource.FrameIndex != other.FrameIndex { - return false - } - if resource.ShowHeader != other.ShowHeader { - return false - } - if resource.ShowTypeIcons == nil && other.ShowTypeIcons != nil || resource.ShowTypeIcons != nil && other.ShowTypeIcons == nil { - return false - } - - if resource.ShowTypeIcons != nil { - if *resource.ShowTypeIcons != *other.ShowTypeIcons { - return false - } - } - - if len(resource.SortBy) != len(other.SortBy) { - return false - } - - for i1 := range resource.SortBy { - if !resource.SortBy[i1].Equals(other.SortBy[i1]) { - return false - } - } - if resource.Footer == nil && other.Footer != nil || resource.Footer != nil && other.Footer == nil { - return false - } - - if resource.Footer != nil { - if !resource.Footer.Equals(*other.Footer) { - return false - } - } - if resource.CellHeight == nil && other.CellHeight != nil || resource.CellHeight != nil && other.CellHeight == nil { - return false - } - - if resource.CellHeight != nil { - if *resource.CellHeight != *other.CellHeight { - return false - } - } - - return true -} - -type FieldConfig = common.TableFieldOptions - -func VariantConfig() variants.PanelcfgConfig { - return variants.PanelcfgConfig{ - Identifier: "table", - OptionsUnmarshaler: func(raw []byte) (any, error) { - options := &Options{} - - if err := json.Unmarshal(raw, options); err != nil { - return nil, err - } - - return options, nil - }, - FieldConfigUnmarshaler: func(raw []byte) (any, error) { - fieldConfig := &FieldConfig{} - - if err := json.Unmarshal(raw, fieldConfig); err != nil { - return nil, err - } - - return fieldConfig, nil - }, - GoConverter: func(inputPanel any) string { - if panel, ok := inputPanel.(*dashboard.Panel); ok { - return PanelConverter(*panel) - } - - return PanelConverter(inputPanel.(dashboard.Panel)) - }, - } -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/csvwave_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/csvwave_builder_gen.go deleted file mode 100644 index 2a808e1bca967..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/csvwave_builder_gen.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[CSVWave] = (*CSVWaveBuilder)(nil) - -type CSVWaveBuilder struct { - internal *CSVWave - errors map[string]cog.BuildErrors -} - -func NewCSVWaveBuilder() *CSVWaveBuilder { - resource := &CSVWave{} - builder := &CSVWaveBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *CSVWaveBuilder) Build() (CSVWave, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("CSVWave", err)...) - } - - if len(errs) != 0 { - return CSVWave{}, errs - } - - return *builder.internal, nil -} - -func (builder *CSVWaveBuilder) Labels(labels string) *CSVWaveBuilder { - builder.internal.Labels = &labels - - return builder -} - -func (builder *CSVWaveBuilder) Name(name string) *CSVWaveBuilder { - builder.internal.Name = &name - - return builder -} - -func (builder *CSVWaveBuilder) TimeStep(timeStep int64) *CSVWaveBuilder { - builder.internal.TimeStep = &timeStep - - return builder -} - -func (builder *CSVWaveBuilder) ValuesCSV(valuesCSV string) *CSVWaveBuilder { - builder.internal.ValuesCSV = &valuesCSV - - return builder -} - -func (builder *CSVWaveBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/csvwave_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/csvwave_converter_gen.go deleted file mode 100644 index a3ad53aabf247..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/csvwave_converter_gen.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func CSVWaveConverter(input CSVWave) string { - calls := []string{ - `testdata.NewCSVWaveBuilder()`, - } - var buffer strings.Builder - if input.Labels != nil && *input.Labels != "" { - - buffer.WriteString(`Labels(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Labels)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Name != nil && *input.Name != "" { - - buffer.WriteString(`Name(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Name)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.TimeStep != nil { - - buffer.WriteString(`TimeStep(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.TimeStep)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.ValuesCSV != nil && *input.ValuesCSV != "" { - - buffer.WriteString(`ValuesCSV(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.ValuesCSV)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/dataquery_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/dataquery_builder_gen.go deleted file mode 100644 index 0efc84e2e354a..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/dataquery_builder_gen.go +++ /dev/null @@ -1,359 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" - variants "github.com/grafana/grafana-foundation-sdk/go/cog/variants" - dashboard "github.com/grafana/grafana-foundation-sdk/go/dashboard" -) - -var _ cog.Builder[variants.Dataquery] = (*DataqueryBuilder)(nil) - -type DataqueryBuilder struct { - internal *Dataquery - errors map[string]cog.BuildErrors -} - -func NewDataqueryBuilder() *DataqueryBuilder { - resource := &Dataquery{} - builder := &DataqueryBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *DataqueryBuilder) Build() (variants.Dataquery, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("Dataquery", err)...) - } - - if len(errs) != 0 { - return Dataquery{}, errs - } - - return *builder.internal, nil -} - -func (builder *DataqueryBuilder) Alias(alias string) *DataqueryBuilder { - builder.internal.Alias = &alias - - return builder -} - -// Used for live query -func (builder *DataqueryBuilder) Channel(channel string) *DataqueryBuilder { - builder.internal.Channel = &channel - - return builder -} - -func (builder *DataqueryBuilder) CsvContent(csvContent string) *DataqueryBuilder { - builder.internal.CsvContent = &csvContent - - return builder -} - -func (builder *DataqueryBuilder) CsvFileName(csvFileName string) *DataqueryBuilder { - builder.internal.CsvFileName = &csvFileName - - return builder -} - -func (builder *DataqueryBuilder) CsvWave(csvWave []cog.Builder[CSVWave]) *DataqueryBuilder { - csvWaveResources := make([]CSVWave, 0, len(csvWave)) - for _, r1 := range csvWave { - csvWaveDepth1, err := r1.Build() - if err != nil { - builder.errors["csvWave"] = err.(cog.BuildErrors) - return builder - } - csvWaveResources = append(csvWaveResources, csvWaveDepth1) - } - builder.internal.CsvWave = csvWaveResources - - return builder -} - -// The datasource -func (builder *DataqueryBuilder) Datasource(datasource dashboard.DataSourceRef) *DataqueryBuilder { - builder.internal.Datasource = &datasource - - return builder -} - -// Drop percentage (the chance we will lose a point 0-100) -func (builder *DataqueryBuilder) DropPercent(dropPercent float64) *DataqueryBuilder { - builder.internal.DropPercent = &dropPercent - - return builder -} - -// Possible enum values: -// - `"frontend_exception"` -// - `"frontend_observable"` -// - `"server_panic"` -func (builder *DataqueryBuilder) ErrorType(errorType DataqueryErrorType) *DataqueryBuilder { - builder.internal.ErrorType = &errorType - - return builder -} - -func (builder *DataqueryBuilder) FlamegraphDiff(flamegraphDiff bool) *DataqueryBuilder { - builder.internal.FlamegraphDiff = &flamegraphDiff - - return builder -} - -// true if query is disabled (ie should not be returned to the dashboard) -// NOTE: this does not always imply that the query should not be executed since -// the results from a hidden query may be used as the input to other queries (SSE etc) -func (builder *DataqueryBuilder) Hide(hide bool) *DataqueryBuilder { - builder.internal.Hide = &hide - - return builder -} - -// Interval is the suggested duration between time points in a time series query. -// NOTE: the values for intervalMs is not saved in the query model. It is typically calculated -// from the interval required to fill a pixels in the visualization -func (builder *DataqueryBuilder) IntervalMs(intervalMs float64) *DataqueryBuilder { - builder.internal.IntervalMs = &intervalMs - - return builder -} - -func (builder *DataqueryBuilder) Labels(labels string) *DataqueryBuilder { - builder.internal.Labels = &labels - - return builder -} - -func (builder *DataqueryBuilder) LevelColumn(levelColumn bool) *DataqueryBuilder { - builder.internal.LevelColumn = &levelColumn - - return builder -} - -func (builder *DataqueryBuilder) Lines(lines int64) *DataqueryBuilder { - builder.internal.Lines = &lines - - return builder -} - -func (builder *DataqueryBuilder) Max(max float64) *DataqueryBuilder { - builder.internal.Max = &max - - return builder -} - -// MaxDataPoints is the maximum number of data points that should be returned from a time series query. -// NOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated -// from the number of pixels visible in a visualization -func (builder *DataqueryBuilder) MaxDataPoints(maxDataPoints int64) *DataqueryBuilder { - builder.internal.MaxDataPoints = &maxDataPoints - - return builder -} - -func (builder *DataqueryBuilder) Min(min float64) *DataqueryBuilder { - builder.internal.Min = &min - - return builder -} - -func (builder *DataqueryBuilder) Nodes(nodes cog.Builder[NodesQuery]) *DataqueryBuilder { - nodesResource, err := nodes.Build() - if err != nil { - builder.errors["nodes"] = err.(cog.BuildErrors) - return builder - } - builder.internal.Nodes = &nodesResource - - return builder -} - -func (builder *DataqueryBuilder) Noise(noise float64) *DataqueryBuilder { - builder.internal.Noise = &noise - - return builder -} - -func (builder *DataqueryBuilder) Points(points [][]any) *DataqueryBuilder { - builder.internal.Points = points - - return builder -} - -func (builder *DataqueryBuilder) PulseWave(pulseWave cog.Builder[PulseWaveQuery]) *DataqueryBuilder { - pulseWaveResource, err := pulseWave.Build() - if err != nil { - builder.errors["pulseWave"] = err.(cog.BuildErrors) - return builder - } - builder.internal.PulseWave = &pulseWaveResource - - return builder -} - -// QueryType is an optional identifier for the type of query. -// It can be used to distinguish different types of queries. -func (builder *DataqueryBuilder) QueryType(queryType string) *DataqueryBuilder { - builder.internal.QueryType = &queryType - - return builder -} - -func (builder *DataqueryBuilder) RawFrameContent(rawFrameContent string) *DataqueryBuilder { - builder.internal.RawFrameContent = &rawFrameContent - - return builder -} - -// RefID is the unique identifier of the query, set by the frontend call. -func (builder *DataqueryBuilder) RefId(refId string) *DataqueryBuilder { - builder.internal.RefId = &refId - - return builder -} - -// Optionally define expected query result behavior -func (builder *DataqueryBuilder) ResultAssertions(resultAssertions cog.Builder[ResultAssertions]) *DataqueryBuilder { - resultAssertionsResource, err := resultAssertions.Build() - if err != nil { - builder.errors["resultAssertions"] = err.(cog.BuildErrors) - return builder - } - builder.internal.ResultAssertions = &resultAssertionsResource - - return builder -} - -// Possible enum values: -// - `"annotations"` -// - `"arrow"` -// - `"csv_content"` -// - `"csv_file"` -// - `"csv_metric_values"` -// - `"datapoints_outside_range"` -// - `"exponential_heatmap_bucket_data"` -// - `"flame_graph"` -// - `"grafana_api"` -// - `"linear_heatmap_bucket_data"` -// - `"live"` -// - `"logs"` -// - `"manual_entry"` -// - `"no_data_points"` -// - `"node_graph"` -// - `"predictable_csv_wave"` -// - `"predictable_pulse"` -// - `"random_walk"` -// - `"random_walk_table"` -// - `"random_walk_with_error"` -// - `"raw_frame"` -// - `"server_error_500"` -// - `"simulation"` -// - `"slow_query"` -// - `"streaming_client"` -// - `"table_static"` -// - `"trace"` -// - `"usa"` -// - `"variables-query"` -func (builder *DataqueryBuilder) ScenarioId(scenarioId DataqueryScenarioId) *DataqueryBuilder { - builder.internal.ScenarioId = &scenarioId - - return builder -} - -func (builder *DataqueryBuilder) SeriesCount(seriesCount int64) *DataqueryBuilder { - builder.internal.SeriesCount = &seriesCount - - return builder -} - -func (builder *DataqueryBuilder) Sim(sim cog.Builder[SimulationQuery]) *DataqueryBuilder { - simResource, err := sim.Build() - if err != nil { - builder.errors["sim"] = err.(cog.BuildErrors) - return builder - } - builder.internal.Sim = &simResource - - return builder -} - -func (builder *DataqueryBuilder) SpanCount(spanCount int64) *DataqueryBuilder { - builder.internal.SpanCount = &spanCount - - return builder -} - -func (builder *DataqueryBuilder) Spread(spread float64) *DataqueryBuilder { - builder.internal.Spread = &spread - - return builder -} - -func (builder *DataqueryBuilder) StartValue(startValue float64) *DataqueryBuilder { - builder.internal.StartValue = &startValue - - return builder -} - -func (builder *DataqueryBuilder) Stream(stream cog.Builder[StreamingQuery]) *DataqueryBuilder { - streamResource, err := stream.Build() - if err != nil { - builder.errors["stream"] = err.(cog.BuildErrors) - return builder - } - builder.internal.Stream = &streamResource - - return builder -} - -// common parameter used by many query types -func (builder *DataqueryBuilder) StringInput(stringInput string) *DataqueryBuilder { - builder.internal.StringInput = &stringInput - - return builder -} - -// TimeRange represents the query range -// NOTE: unlike generic /ds/query, we can now send explicit time values in each query -// NOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly -func (builder *DataqueryBuilder) TimeRange(timeRange cog.Builder[TimeRange]) *DataqueryBuilder { - timeRangeResource, err := timeRange.Build() - if err != nil { - builder.errors["timeRange"] = err.(cog.BuildErrors) - return builder - } - builder.internal.TimeRange = &timeRangeResource - - return builder -} - -func (builder *DataqueryBuilder) Usa(usa cog.Builder[USAQuery]) *DataqueryBuilder { - usaResource, err := usa.Build() - if err != nil { - builder.errors["usa"] = err.(cog.BuildErrors) - return builder - } - builder.internal.Usa = &usaResource - - return builder -} - -func (builder *DataqueryBuilder) WithNil(withNil bool) *DataqueryBuilder { - builder.internal.WithNil = &withNil - - return builder -} - -func (builder *DataqueryBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/dataquery_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/dataquery_converter_gen.go deleted file mode 100644 index f5acc6560971d..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/dataquery_converter_gen.go +++ /dev/null @@ -1,466 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func DataqueryConverter(input Dataquery) string { - calls := []string{ - `testdata.NewDataqueryBuilder()`, - } - var buffer strings.Builder - if input.Alias != nil && *input.Alias != "" { - - buffer.WriteString(`Alias(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Alias)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Channel != nil && *input.Channel != "" { - - buffer.WriteString(`Channel(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Channel)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.CsvContent != nil && *input.CsvContent != "" { - - buffer.WriteString(`CsvContent(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.CsvContent)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.CsvFileName != nil && *input.CsvFileName != "" { - - buffer.WriteString(`CsvFileName(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.CsvFileName)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.CsvWave != nil && len(input.CsvWave) >= 1 { - - buffer.WriteString(`CsvWave(`) - tmparg0 := []string{} - for _, arg1 := range input.CsvWave { - tmpcsvWavearg1 := CSVWaveConverter(arg1) - tmparg0 = append(tmparg0, tmpcsvWavearg1) - } - arg0 := "[]cog.Builder[testdata.CSVWave]{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Datasource != nil { - - buffer.WriteString(`Datasource(`) - arg0 := cog.Dump(*input.Datasource) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.DropPercent != nil { - - buffer.WriteString(`DropPercent(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.DropPercent)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.ErrorType != nil { - - buffer.WriteString(`ErrorType(`) - arg0 := cog.Dump(*input.ErrorType) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.FlamegraphDiff != nil { - - buffer.WriteString(`FlamegraphDiff(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.FlamegraphDiff)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Hide != nil { - - buffer.WriteString(`Hide(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Hide)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.IntervalMs != nil { - - buffer.WriteString(`IntervalMs(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.IntervalMs)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Labels != nil && *input.Labels != "" { - - buffer.WriteString(`Labels(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Labels)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.LevelColumn != nil { - - buffer.WriteString(`LevelColumn(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.LevelColumn)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Lines != nil { - - buffer.WriteString(`Lines(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Lines)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Max != nil { - - buffer.WriteString(`Max(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Max)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.MaxDataPoints != nil { - - buffer.WriteString(`MaxDataPoints(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.MaxDataPoints)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Min != nil { - - buffer.WriteString(`Min(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Min)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Nodes != nil { - - buffer.WriteString(`Nodes(`) - arg0 := NodesQueryConverter(*input.Nodes) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Noise != nil { - - buffer.WriteString(`Noise(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Noise)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Points != nil && len(input.Points) >= 1 { - - buffer.WriteString(`Points(`) - tmparg0 := []string{} - for _, arg1 := range input.Points { - tmptmppointsarg1 := []string{} - for _, arg1Value := range arg1 { - tmparg1arg1Value := cog.Dump(arg1Value) - tmptmppointsarg1 = append(tmptmppointsarg1, tmparg1arg1Value) - } - tmppointsarg1 := "[]any{" + strings.Join(tmptmppointsarg1, ",\n") + "}" - tmparg0 = append(tmparg0, tmppointsarg1) - } - arg0 := "[][]any{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.PulseWave != nil { - - buffer.WriteString(`PulseWave(`) - arg0 := PulseWaveQueryConverter(*input.PulseWave) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.QueryType != nil && *input.QueryType != "" { - - buffer.WriteString(`QueryType(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.QueryType)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.RawFrameContent != nil && *input.RawFrameContent != "" { - - buffer.WriteString(`RawFrameContent(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.RawFrameContent)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.RefId != nil && *input.RefId != "" { - - buffer.WriteString(`RefId(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.RefId)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.ResultAssertions != nil { - - buffer.WriteString(`ResultAssertions(`) - arg0 := ResultAssertionsConverter(*input.ResultAssertions) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.ScenarioId != nil { - - buffer.WriteString(`ScenarioId(`) - arg0 := cog.Dump(*input.ScenarioId) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.SeriesCount != nil { - - buffer.WriteString(`SeriesCount(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.SeriesCount)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Sim != nil { - - buffer.WriteString(`Sim(`) - arg0 := SimulationQueryConverter(*input.Sim) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.SpanCount != nil { - - buffer.WriteString(`SpanCount(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.SpanCount)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Spread != nil { - - buffer.WriteString(`Spread(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Spread)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.StartValue != nil { - - buffer.WriteString(`StartValue(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.StartValue)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Stream != nil { - - buffer.WriteString(`Stream(`) - arg0 := StreamingQueryConverter(*input.Stream) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.StringInput != nil && *input.StringInput != "" { - - buffer.WriteString(`StringInput(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.StringInput)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.TimeRange != nil { - - buffer.WriteString(`TimeRange(`) - arg0 := TimeRangeConverter(*input.TimeRange) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Usa != nil { - - buffer.WriteString(`Usa(`) - arg0 := USAQueryConverter(*input.Usa) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.WithNil != nil { - - buffer.WriteString(`WithNil(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.WithNil)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/key_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/key_builder_gen.go deleted file mode 100644 index 8b2c5345de726..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/key_builder_gen.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[Key] = (*KeyBuilder)(nil) - -type KeyBuilder struct { - internal *Key - errors map[string]cog.BuildErrors -} - -func NewKeyBuilder() *KeyBuilder { - resource := &Key{} - builder := &KeyBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *KeyBuilder) Build() (Key, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("Key", err)...) - } - - if len(errs) != 0 { - return Key{}, errs - } - - return *builder.internal, nil -} - -func (builder *KeyBuilder) Tick(tick float64) *KeyBuilder { - builder.internal.Tick = tick - - return builder -} - -func (builder *KeyBuilder) Type(typeArg string) *KeyBuilder { - builder.internal.Type = typeArg - - return builder -} - -func (builder *KeyBuilder) Uid(uid string) *KeyBuilder { - builder.internal.Uid = &uid - - return builder -} - -func (builder *KeyBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/key_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/key_converter_gen.go deleted file mode 100644 index 11af74cf7bcc9..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/key_converter_gen.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func KeyConverter(input Key) string { - calls := []string{ - `testdata.NewKeyBuilder()`, - } - var buffer strings.Builder - - { - buffer.WriteString(`Tick(`) - arg0 := fmt.Sprintf("%#v", input.Tick) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - } - - if input.Type != "" { - - buffer.WriteString(`Type(`) - arg0 := fmt.Sprintf("%#v", input.Type) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Uid != nil && *input.Uid != "" { - - buffer.WriteString(`Uid(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Uid)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/nodesquery_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/nodesquery_builder_gen.go deleted file mode 100644 index 62a3671bf4f3c..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/nodesquery_builder_gen.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[NodesQuery] = (*NodesQueryBuilder)(nil) - -type NodesQueryBuilder struct { - internal *NodesQuery - errors map[string]cog.BuildErrors -} - -func NewNodesQueryBuilder() *NodesQueryBuilder { - resource := &NodesQuery{} - builder := &NodesQueryBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *NodesQueryBuilder) Build() (NodesQuery, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("NodesQuery", err)...) - } - - if len(errs) != 0 { - return NodesQuery{}, errs - } - - return *builder.internal, nil -} - -func (builder *NodesQueryBuilder) Count(count int64) *NodesQueryBuilder { - builder.internal.Count = &count - - return builder -} - -func (builder *NodesQueryBuilder) Seed(seed int64) *NodesQueryBuilder { - builder.internal.Seed = &seed - - return builder -} - -// Possible enum values: -// - `"random"` -// - `"random edges"` -// - `"response_medium"` -// - `"response_small"` -// - `"feature_showcase"` -func (builder *NodesQueryBuilder) Type(typeArg NodesQueryType) *NodesQueryBuilder { - builder.internal.Type = &typeArg - - return builder -} - -func (builder *NodesQueryBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/nodesquery_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/nodesquery_converter_gen.go deleted file mode 100644 index ce955696c2904..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/nodesquery_converter_gen.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func NodesQueryConverter(input NodesQuery) string { - calls := []string{ - `testdata.NewNodesQueryBuilder()`, - } - var buffer strings.Builder - if input.Count != nil { - - buffer.WriteString(`Count(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Count)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Seed != nil { - - buffer.WriteString(`Seed(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Seed)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Type != nil { - - buffer.WriteString(`Type(`) - arg0 := cog.Dump(*input.Type) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/pulsewavequery_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/pulsewavequery_builder_gen.go deleted file mode 100644 index 390f9fcaac13d..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/pulsewavequery_builder_gen.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[PulseWaveQuery] = (*PulseWaveQueryBuilder)(nil) - -type PulseWaveQueryBuilder struct { - internal *PulseWaveQuery - errors map[string]cog.BuildErrors -} - -func NewPulseWaveQueryBuilder() *PulseWaveQueryBuilder { - resource := &PulseWaveQuery{} - builder := &PulseWaveQueryBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *PulseWaveQueryBuilder) Build() (PulseWaveQuery, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("PulseWaveQuery", err)...) - } - - if len(errs) != 0 { - return PulseWaveQuery{}, errs - } - - return *builder.internal, nil -} - -func (builder *PulseWaveQueryBuilder) OffCount(offCount int64) *PulseWaveQueryBuilder { - builder.internal.OffCount = &offCount - - return builder -} - -func (builder *PulseWaveQueryBuilder) OffValue(offValue float64) *PulseWaveQueryBuilder { - builder.internal.OffValue = &offValue - - return builder -} - -func (builder *PulseWaveQueryBuilder) OnCount(onCount int64) *PulseWaveQueryBuilder { - builder.internal.OnCount = &onCount - - return builder -} - -func (builder *PulseWaveQueryBuilder) OnValue(onValue float64) *PulseWaveQueryBuilder { - builder.internal.OnValue = &onValue - - return builder -} - -func (builder *PulseWaveQueryBuilder) TimeStep(timeStep int64) *PulseWaveQueryBuilder { - builder.internal.TimeStep = &timeStep - - return builder -} - -func (builder *PulseWaveQueryBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/pulsewavequery_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/pulsewavequery_converter_gen.go deleted file mode 100644 index c091fab150121..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/pulsewavequery_converter_gen.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func PulseWaveQueryConverter(input PulseWaveQuery) string { - calls := []string{ - `testdata.NewPulseWaveQueryBuilder()`, - } - var buffer strings.Builder - if input.OffCount != nil { - - buffer.WriteString(`OffCount(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.OffCount)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.OffValue != nil { - - buffer.WriteString(`OffValue(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.OffValue)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.OnCount != nil { - - buffer.WriteString(`OnCount(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.OnCount)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.OnValue != nil { - - buffer.WriteString(`OnValue(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.OnValue)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.TimeStep != nil { - - buffer.WriteString(`TimeStep(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.TimeStep)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/resultassertions_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/resultassertions_builder_gen.go deleted file mode 100644 index d117f1949f4b9..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/resultassertions_builder_gen.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[ResultAssertions] = (*ResultAssertionsBuilder)(nil) - -type ResultAssertionsBuilder struct { - internal *ResultAssertions - errors map[string]cog.BuildErrors -} - -func NewResultAssertionsBuilder() *ResultAssertionsBuilder { - resource := &ResultAssertions{} - builder := &ResultAssertionsBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *ResultAssertionsBuilder) Build() (ResultAssertions, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("ResultAssertions", err)...) - } - - if len(errs) != 0 { - return ResultAssertions{}, errs - } - - return *builder.internal, nil -} - -// Maximum frame count -func (builder *ResultAssertionsBuilder) MaxFrames(maxFrames int64) *ResultAssertionsBuilder { - builder.internal.MaxFrames = &maxFrames - - return builder -} - -// Type asserts that the frame matches a known type structure. -// Possible enum values: -// - `""` -// - `"timeseries-wide"` -// - `"timeseries-long"` -// - `"timeseries-many"` -// - `"timeseries-multi"` -// - `"directory-listing"` -// - `"table"` -// - `"numeric-wide"` -// - `"numeric-multi"` -// - `"numeric-long"` -// - `"log-lines"` -func (builder *ResultAssertionsBuilder) Type(typeArg ResultAssertionsType) *ResultAssertionsBuilder { - builder.internal.Type = &typeArg - - return builder -} - -// TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane -// contract documentation https://grafana.github.io/dataplane/contract/. -func (builder *ResultAssertionsBuilder) TypeVersion(typeVersion []int64) *ResultAssertionsBuilder { - builder.internal.TypeVersion = typeVersion - - return builder -} - -func (builder *ResultAssertionsBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/resultassertions_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/resultassertions_converter_gen.go deleted file mode 100644 index 85e7ba7351177..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/resultassertions_converter_gen.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func ResultAssertionsConverter(input ResultAssertions) string { - calls := []string{ - `testdata.NewResultAssertionsBuilder()`, - } - var buffer strings.Builder - if input.MaxFrames != nil { - - buffer.WriteString(`MaxFrames(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.MaxFrames)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Type != nil { - - buffer.WriteString(`Type(`) - arg0 := cog.Dump(*input.Type) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.TypeVersion != nil && len(input.TypeVersion) >= 1 { - - buffer.WriteString(`TypeVersion(`) - tmparg0 := []string{} - for _, arg1 := range input.TypeVersion { - tmptypeVersionarg1 := fmt.Sprintf("%#v", arg1) - tmparg0 = append(tmparg0, tmptypeVersionarg1) - } - arg0 := "[]int64{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/simulationquery_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/simulationquery_builder_gen.go deleted file mode 100644 index 2fb4b295de3b7..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/simulationquery_builder_gen.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[SimulationQuery] = (*SimulationQueryBuilder)(nil) - -type SimulationQueryBuilder struct { - internal *SimulationQuery - errors map[string]cog.BuildErrors -} - -func NewSimulationQueryBuilder() *SimulationQueryBuilder { - resource := &SimulationQuery{} - builder := &SimulationQueryBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *SimulationQueryBuilder) Build() (SimulationQuery, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("SimulationQuery", err)...) - } - - if len(errs) != 0 { - return SimulationQuery{}, errs - } - - return *builder.internal, nil -} - -func (builder *SimulationQueryBuilder) Config(config any) *SimulationQueryBuilder { - builder.internal.Config = &config - - return builder -} - -func (builder *SimulationQueryBuilder) Key(key cog.Builder[Key]) *SimulationQueryBuilder { - keyResource, err := key.Build() - if err != nil { - builder.errors["key"] = err.(cog.BuildErrors) - return builder - } - builder.internal.Key = keyResource - - return builder -} - -func (builder *SimulationQueryBuilder) Last(last bool) *SimulationQueryBuilder { - builder.internal.Last = &last - - return builder -} - -func (builder *SimulationQueryBuilder) Stream(stream bool) *SimulationQueryBuilder { - builder.internal.Stream = &stream - - return builder -} - -func (builder *SimulationQueryBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/simulationquery_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/simulationquery_converter_gen.go deleted file mode 100644 index 2d5a3922969d8..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/simulationquery_converter_gen.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func SimulationQueryConverter(input SimulationQuery) string { - calls := []string{ - `testdata.NewSimulationQueryBuilder()`, - } - var buffer strings.Builder - if input.Config != nil { - - buffer.WriteString(`Config(`) - arg0 := cog.Dump(input.Config) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - { - buffer.WriteString(`Key(`) - arg0 := KeyConverter(input.Key) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - } - - if input.Last != nil { - - buffer.WriteString(`Last(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Last)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Stream != nil { - - buffer.WriteString(`Stream(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Stream)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/streamingquery_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/streamingquery_builder_gen.go deleted file mode 100644 index 110a952f31e48..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/streamingquery_builder_gen.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[StreamingQuery] = (*StreamingQueryBuilder)(nil) - -type StreamingQueryBuilder struct { - internal *StreamingQuery - errors map[string]cog.BuildErrors -} - -func NewStreamingQueryBuilder() *StreamingQueryBuilder { - resource := &StreamingQuery{} - builder := &StreamingQueryBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *StreamingQueryBuilder) Build() (StreamingQuery, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("StreamingQuery", err)...) - } - - if len(errs) != 0 { - return StreamingQuery{}, errs - } - - return *builder.internal, nil -} - -func (builder *StreamingQueryBuilder) Bands(bands int64) *StreamingQueryBuilder { - builder.internal.Bands = &bands - - return builder -} - -func (builder *StreamingQueryBuilder) Noise(noise float64) *StreamingQueryBuilder { - builder.internal.Noise = noise - - return builder -} - -func (builder *StreamingQueryBuilder) Speed(speed float64) *StreamingQueryBuilder { - builder.internal.Speed = speed - - return builder -} - -func (builder *StreamingQueryBuilder) Spread(spread float64) *StreamingQueryBuilder { - builder.internal.Spread = spread - - return builder -} - -// Possible enum values: -// - `"fetch"` -// - `"logs"` -// - `"signal"` -// - `"traces"` -func (builder *StreamingQueryBuilder) Type(typeArg StreamingQueryType) *StreamingQueryBuilder { - builder.internal.Type = typeArg - - return builder -} - -func (builder *StreamingQueryBuilder) Url(url string) *StreamingQueryBuilder { - builder.internal.Url = &url - - return builder -} - -func (builder *StreamingQueryBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/streamingquery_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/streamingquery_converter_gen.go deleted file mode 100644 index da65e76f88b5c..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/streamingquery_converter_gen.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func StreamingQueryConverter(input StreamingQuery) string { - calls := []string{ - `testdata.NewStreamingQueryBuilder()`, - } - var buffer strings.Builder - if input.Bands != nil { - - buffer.WriteString(`Bands(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Bands)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - { - buffer.WriteString(`Noise(`) - arg0 := fmt.Sprintf("%#v", input.Noise) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - } - - { - buffer.WriteString(`Speed(`) - arg0 := fmt.Sprintf("%#v", input.Speed) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - } - - { - buffer.WriteString(`Spread(`) - arg0 := fmt.Sprintf("%#v", input.Spread) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - } - - { - buffer.WriteString(`Type(`) - arg0 := cog.Dump(input.Type) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - } - - if input.Url != nil && *input.Url != "" { - - buffer.WriteString(`Url(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Url)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/timerange_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/timerange_builder_gen.go deleted file mode 100644 index 7c3556812e574..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/timerange_builder_gen.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[TimeRange] = (*TimeRangeBuilder)(nil) - -type TimeRangeBuilder struct { - internal *TimeRange - errors map[string]cog.BuildErrors -} - -func NewTimeRangeBuilder() *TimeRangeBuilder { - resource := &TimeRange{} - builder := &TimeRangeBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *TimeRangeBuilder) Build() (TimeRange, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("TimeRange", err)...) - } - - if len(errs) != 0 { - return TimeRange{}, errs - } - - return *builder.internal, nil -} - -// From is the start time of the query. -func (builder *TimeRangeBuilder) From(from string) *TimeRangeBuilder { - builder.internal.From = from - - return builder -} - -// To is the end time of the query. -func (builder *TimeRangeBuilder) To(to string) *TimeRangeBuilder { - builder.internal.To = to - - return builder -} - -func (builder *TimeRangeBuilder) applyDefaults() { - builder.From("now-6h") - builder.To("now") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/timerange_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/timerange_converter_gen.go deleted file mode 100644 index 78f4c7c962de6..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/timerange_converter_gen.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" -) - -func TimeRangeConverter(input TimeRange) string { - calls := []string{ - `testdata.NewTimeRangeBuilder()`, - } - var buffer strings.Builder - if input.From != "" && input.From != "now-6h" { - - buffer.WriteString(`From(`) - arg0 := fmt.Sprintf("%#v", input.From) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.To != "" && input.To != "now" { - - buffer.WriteString(`To(`) - arg0 := fmt.Sprintf("%#v", input.To) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/types_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/types_gen.go deleted file mode 100644 index 4199dbd9c1a3f..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/types_gen.go +++ /dev/null @@ -1,943 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "encoding/json" - "reflect" - - variants "github.com/grafana/grafana-foundation-sdk/go/cog/variants" - dashboard "github.com/grafana/grafana-foundation-sdk/go/dashboard" -) - -type CSVWave struct { - Labels *string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` - TimeStep *int64 `json:"timeStep,omitempty"` - ValuesCSV *string `json:"valuesCSV,omitempty"` -} - -func (resource CSVWave) Equals(other CSVWave) bool { - if resource.Labels == nil && other.Labels != nil || resource.Labels != nil && other.Labels == nil { - return false - } - - if resource.Labels != nil { - if *resource.Labels != *other.Labels { - return false - } - } - if resource.Name == nil && other.Name != nil || resource.Name != nil && other.Name == nil { - return false - } - - if resource.Name != nil { - if *resource.Name != *other.Name { - return false - } - } - if resource.TimeStep == nil && other.TimeStep != nil || resource.TimeStep != nil && other.TimeStep == nil { - return false - } - - if resource.TimeStep != nil { - if *resource.TimeStep != *other.TimeStep { - return false - } - } - if resource.ValuesCSV == nil && other.ValuesCSV != nil || resource.ValuesCSV != nil && other.ValuesCSV == nil { - return false - } - - if resource.ValuesCSV != nil { - if *resource.ValuesCSV != *other.ValuesCSV { - return false - } - } - - return true -} - -type NodesQuery struct { - Count *int64 `json:"count,omitempty"` - Seed *int64 `json:"seed,omitempty"` - // Possible enum values: - // - `"random"` - // - `"random edges"` - // - `"response_medium"` - // - `"response_small"` - // - `"feature_showcase"` - Type *NodesQueryType `json:"type,omitempty"` -} - -func (resource NodesQuery) Equals(other NodesQuery) bool { - if resource.Count == nil && other.Count != nil || resource.Count != nil && other.Count == nil { - return false - } - - if resource.Count != nil { - if *resource.Count != *other.Count { - return false - } - } - if resource.Seed == nil && other.Seed != nil || resource.Seed != nil && other.Seed == nil { - return false - } - - if resource.Seed != nil { - if *resource.Seed != *other.Seed { - return false - } - } - if resource.Type == nil && other.Type != nil || resource.Type != nil && other.Type == nil { - return false - } - - if resource.Type != nil { - if *resource.Type != *other.Type { - return false - } - } - - return true -} - -type PulseWaveQuery struct { - OffCount *int64 `json:"offCount,omitempty"` - OffValue *float64 `json:"offValue,omitempty"` - OnCount *int64 `json:"onCount,omitempty"` - OnValue *float64 `json:"onValue,omitempty"` - TimeStep *int64 `json:"timeStep,omitempty"` -} - -func (resource PulseWaveQuery) Equals(other PulseWaveQuery) bool { - if resource.OffCount == nil && other.OffCount != nil || resource.OffCount != nil && other.OffCount == nil { - return false - } - - if resource.OffCount != nil { - if *resource.OffCount != *other.OffCount { - return false - } - } - if resource.OffValue == nil && other.OffValue != nil || resource.OffValue != nil && other.OffValue == nil { - return false - } - - if resource.OffValue != nil { - if *resource.OffValue != *other.OffValue { - return false - } - } - if resource.OnCount == nil && other.OnCount != nil || resource.OnCount != nil && other.OnCount == nil { - return false - } - - if resource.OnCount != nil { - if *resource.OnCount != *other.OnCount { - return false - } - } - if resource.OnValue == nil && other.OnValue != nil || resource.OnValue != nil && other.OnValue == nil { - return false - } - - if resource.OnValue != nil { - if *resource.OnValue != *other.OnValue { - return false - } - } - if resource.TimeStep == nil && other.TimeStep != nil || resource.TimeStep != nil && other.TimeStep == nil { - return false - } - - if resource.TimeStep != nil { - if *resource.TimeStep != *other.TimeStep { - return false - } - } - - return true -} - -type ResultAssertions struct { - // Maximum frame count - MaxFrames *int64 `json:"maxFrames,omitempty"` - // Type asserts that the frame matches a known type structure. - // Possible enum values: - // - `""` - // - `"timeseries-wide"` - // - `"timeseries-long"` - // - `"timeseries-many"` - // - `"timeseries-multi"` - // - `"directory-listing"` - // - `"table"` - // - `"numeric-wide"` - // - `"numeric-multi"` - // - `"numeric-long"` - // - `"log-lines"` - Type *ResultAssertionsType `json:"type,omitempty"` - // TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane - // contract documentation https://grafana.github.io/dataplane/contract/. - TypeVersion []int64 `json:"typeVersion"` -} - -func (resource ResultAssertions) Equals(other ResultAssertions) bool { - if resource.MaxFrames == nil && other.MaxFrames != nil || resource.MaxFrames != nil && other.MaxFrames == nil { - return false - } - - if resource.MaxFrames != nil { - if *resource.MaxFrames != *other.MaxFrames { - return false - } - } - if resource.Type == nil && other.Type != nil || resource.Type != nil && other.Type == nil { - return false - } - - if resource.Type != nil { - if *resource.Type != *other.Type { - return false - } - } - - if len(resource.TypeVersion) != len(other.TypeVersion) { - return false - } - - for i1 := range resource.TypeVersion { - if resource.TypeVersion[i1] != other.TypeVersion[i1] { - return false - } - } - - return true -} - -type Key struct { - Tick float64 `json:"tick"` - Type string `json:"type"` - Uid *string `json:"uid,omitempty"` -} - -func (resource Key) Equals(other Key) bool { - if resource.Tick != other.Tick { - return false - } - if resource.Type != other.Type { - return false - } - if resource.Uid == nil && other.Uid != nil || resource.Uid != nil && other.Uid == nil { - return false - } - - if resource.Uid != nil { - if *resource.Uid != *other.Uid { - return false - } - } - - return true -} - -type SimulationQuery struct { - Config any `json:"config,omitempty"` - Key Key `json:"key"` - Last *bool `json:"last,omitempty"` - Stream *bool `json:"stream,omitempty"` -} - -func (resource SimulationQuery) Equals(other SimulationQuery) bool { - // is DeepEqual good enough here? - if !reflect.DeepEqual(resource.Config, other.Config) { - return false - } - if !resource.Key.Equals(other.Key) { - return false - } - if resource.Last == nil && other.Last != nil || resource.Last != nil && other.Last == nil { - return false - } - - if resource.Last != nil { - if *resource.Last != *other.Last { - return false - } - } - if resource.Stream == nil && other.Stream != nil || resource.Stream != nil && other.Stream == nil { - return false - } - - if resource.Stream != nil { - if *resource.Stream != *other.Stream { - return false - } - } - - return true -} - -type StreamingQuery struct { - Bands *int64 `json:"bands,omitempty"` - Noise float64 `json:"noise"` - Speed float64 `json:"speed"` - Spread float64 `json:"spread"` - // Possible enum values: - // - `"fetch"` - // - `"logs"` - // - `"signal"` - // - `"traces"` - Type StreamingQueryType `json:"type"` - Url *string `json:"url,omitempty"` -} - -func (resource StreamingQuery) Equals(other StreamingQuery) bool { - if resource.Bands == nil && other.Bands != nil || resource.Bands != nil && other.Bands == nil { - return false - } - - if resource.Bands != nil { - if *resource.Bands != *other.Bands { - return false - } - } - if resource.Noise != other.Noise { - return false - } - if resource.Speed != other.Speed { - return false - } - if resource.Spread != other.Spread { - return false - } - if resource.Type != other.Type { - return false - } - if resource.Url == nil && other.Url != nil || resource.Url != nil && other.Url == nil { - return false - } - - if resource.Url != nil { - if *resource.Url != *other.Url { - return false - } - } - - return true -} - -type TimeRange struct { - // From is the start time of the query. - From string `json:"from"` - // To is the end time of the query. - To string `json:"to"` -} - -func (resource TimeRange) Equals(other TimeRange) bool { - if resource.From != other.From { - return false - } - if resource.To != other.To { - return false - } - - return true -} - -type USAQuery struct { - Fields []string `json:"fields,omitempty"` - Mode *string `json:"mode,omitempty"` - Period *string `json:"period,omitempty"` - States []string `json:"states,omitempty"` -} - -func (resource USAQuery) Equals(other USAQuery) bool { - - if len(resource.Fields) != len(other.Fields) { - return false - } - - for i1 := range resource.Fields { - if resource.Fields[i1] != other.Fields[i1] { - return false - } - } - if resource.Mode == nil && other.Mode != nil || resource.Mode != nil && other.Mode == nil { - return false - } - - if resource.Mode != nil { - if *resource.Mode != *other.Mode { - return false - } - } - if resource.Period == nil && other.Period != nil || resource.Period != nil && other.Period == nil { - return false - } - - if resource.Period != nil { - if *resource.Period != *other.Period { - return false - } - } - - if len(resource.States) != len(other.States) { - return false - } - - for i1 := range resource.States { - if resource.States[i1] != other.States[i1] { - return false - } - } - - return true -} - -type Dataquery struct { - Alias *string `json:"alias,omitempty"` - // Used for live query - Channel *string `json:"channel,omitempty"` - CsvContent *string `json:"csvContent,omitempty"` - CsvFileName *string `json:"csvFileName,omitempty"` - CsvWave []CSVWave `json:"csvWave,omitempty"` - // The datasource - Datasource *dashboard.DataSourceRef `json:"datasource,omitempty"` - // Drop percentage (the chance we will lose a point 0-100) - DropPercent *float64 `json:"dropPercent,omitempty"` - // Possible enum values: - // - `"frontend_exception"` - // - `"frontend_observable"` - // - `"server_panic"` - ErrorType *DataqueryErrorType `json:"errorType,omitempty"` - FlamegraphDiff *bool `json:"flamegraphDiff,omitempty"` - // true if query is disabled (ie should not be returned to the dashboard) - // NOTE: this does not always imply that the query should not be executed since - // the results from a hidden query may be used as the input to other queries (SSE etc) - Hide *bool `json:"hide,omitempty"` - // Interval is the suggested duration between time points in a time series query. - // NOTE: the values for intervalMs is not saved in the query model. It is typically calculated - // from the interval required to fill a pixels in the visualization - IntervalMs *float64 `json:"intervalMs,omitempty"` - Labels *string `json:"labels,omitempty"` - LevelColumn *bool `json:"levelColumn,omitempty"` - Lines *int64 `json:"lines,omitempty"` - Max *float64 `json:"max,omitempty"` - // MaxDataPoints is the maximum number of data points that should be returned from a time series query. - // NOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated - // from the number of pixels visible in a visualization - MaxDataPoints *int64 `json:"maxDataPoints,omitempty"` - Min *float64 `json:"min,omitempty"` - Nodes *NodesQuery `json:"nodes,omitempty"` - Noise *float64 `json:"noise,omitempty"` - Points [][]any `json:"points,omitempty"` - PulseWave *PulseWaveQuery `json:"pulseWave,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"` - RawFrameContent *string `json:"rawFrameContent,omitempty"` - // RefID is the unique identifier of the query, set by the frontend call. - RefId *string `json:"refId,omitempty"` - // Optionally define expected query result behavior - ResultAssertions *ResultAssertions `json:"resultAssertions,omitempty"` - // Possible enum values: - // - `"annotations"` - // - `"arrow"` - // - `"csv_content"` - // - `"csv_file"` - // - `"csv_metric_values"` - // - `"datapoints_outside_range"` - // - `"exponential_heatmap_bucket_data"` - // - `"flame_graph"` - // - `"grafana_api"` - // - `"linear_heatmap_bucket_data"` - // - `"live"` - // - `"logs"` - // - `"manual_entry"` - // - `"no_data_points"` - // - `"node_graph"` - // - `"predictable_csv_wave"` - // - `"predictable_pulse"` - // - `"random_walk"` - // - `"random_walk_table"` - // - `"random_walk_with_error"` - // - `"raw_frame"` - // - `"server_error_500"` - // - `"simulation"` - // - `"slow_query"` - // - `"streaming_client"` - // - `"table_static"` - // - `"trace"` - // - `"usa"` - // - `"variables-query"` - ScenarioId *DataqueryScenarioId `json:"scenarioId,omitempty"` - SeriesCount *int64 `json:"seriesCount,omitempty"` - Sim *SimulationQuery `json:"sim,omitempty"` - SpanCount *int64 `json:"spanCount,omitempty"` - Spread *float64 `json:"spread,omitempty"` - StartValue *float64 `json:"startValue,omitempty"` - Stream *StreamingQuery `json:"stream,omitempty"` - // common parameter used by many query types - StringInput *string `json:"stringInput,omitempty"` - // TimeRange represents the query range - // NOTE: unlike generic /ds/query, we can now send explicit time values in each query - // NOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly - TimeRange *TimeRange `json:"timeRange,omitempty"` - Usa *USAQuery `json:"usa,omitempty"` - WithNil *bool `json:"withNil,omitempty"` -} - -func (resource Dataquery) ImplementsDataqueryVariant() {} - -func (resource Dataquery) DataqueryType() string { - return "" -} - -func VariantConfig() variants.DataqueryConfig { - return variants.DataqueryConfig{ - Identifier: "", - DataqueryUnmarshaler: func(raw []byte) (variants.Dataquery, error) { - dataquery := &Dataquery{} - - if err := json.Unmarshal(raw, dataquery); err != nil { - return nil, err - } - - return dataquery, nil - }, - GoConverter: func(input any) string { - var dataquery Dataquery - if cast, ok := input.(*Dataquery); ok { - dataquery = *cast - } else { - dataquery = input.(Dataquery) - } - return DataqueryConverter(dataquery) - }, - } -} - -func (resource Dataquery) Equals(otherCandidate variants.Dataquery) bool { - if otherCandidate == nil { - return false - } - - other, ok := otherCandidate.(Dataquery) - if !ok { - return false - } - if resource.Alias == nil && other.Alias != nil || resource.Alias != nil && other.Alias == nil { - return false - } - - if resource.Alias != nil { - if *resource.Alias != *other.Alias { - return false - } - } - if resource.Channel == nil && other.Channel != nil || resource.Channel != nil && other.Channel == nil { - return false - } - - if resource.Channel != nil { - if *resource.Channel != *other.Channel { - return false - } - } - if resource.CsvContent == nil && other.CsvContent != nil || resource.CsvContent != nil && other.CsvContent == nil { - return false - } - - if resource.CsvContent != nil { - if *resource.CsvContent != *other.CsvContent { - return false - } - } - if resource.CsvFileName == nil && other.CsvFileName != nil || resource.CsvFileName != nil && other.CsvFileName == nil { - return false - } - - if resource.CsvFileName != nil { - if *resource.CsvFileName != *other.CsvFileName { - return false - } - } - - if len(resource.CsvWave) != len(other.CsvWave) { - return false - } - - for i1 := range resource.CsvWave { - if !resource.CsvWave[i1].Equals(other.CsvWave[i1]) { - return false - } - } - if resource.Datasource == nil && other.Datasource != nil || resource.Datasource != nil && other.Datasource == nil { - return false - } - - if resource.Datasource != nil { - if !resource.Datasource.Equals(*other.Datasource) { - return false - } - } - if resource.DropPercent == nil && other.DropPercent != nil || resource.DropPercent != nil && other.DropPercent == nil { - return false - } - - if resource.DropPercent != nil { - if *resource.DropPercent != *other.DropPercent { - return false - } - } - if resource.ErrorType == nil && other.ErrorType != nil || resource.ErrorType != nil && other.ErrorType == nil { - return false - } - - if resource.ErrorType != nil { - if *resource.ErrorType != *other.ErrorType { - return false - } - } - if resource.FlamegraphDiff == nil && other.FlamegraphDiff != nil || resource.FlamegraphDiff != nil && other.FlamegraphDiff == nil { - return false - } - - if resource.FlamegraphDiff != nil { - if *resource.FlamegraphDiff != *other.FlamegraphDiff { - return false - } - } - if resource.Hide == nil && other.Hide != nil || resource.Hide != nil && other.Hide == nil { - return false - } - - if resource.Hide != nil { - if *resource.Hide != *other.Hide { - return false - } - } - if resource.IntervalMs == nil && other.IntervalMs != nil || resource.IntervalMs != nil && other.IntervalMs == nil { - return false - } - - if resource.IntervalMs != nil { - if *resource.IntervalMs != *other.IntervalMs { - return false - } - } - if resource.Labels == nil && other.Labels != nil || resource.Labels != nil && other.Labels == nil { - return false - } - - if resource.Labels != nil { - if *resource.Labels != *other.Labels { - return false - } - } - if resource.LevelColumn == nil && other.LevelColumn != nil || resource.LevelColumn != nil && other.LevelColumn == nil { - return false - } - - if resource.LevelColumn != nil { - if *resource.LevelColumn != *other.LevelColumn { - return false - } - } - if resource.Lines == nil && other.Lines != nil || resource.Lines != nil && other.Lines == nil { - return false - } - - if resource.Lines != nil { - if *resource.Lines != *other.Lines { - return false - } - } - if resource.Max == nil && other.Max != nil || resource.Max != nil && other.Max == nil { - return false - } - - if resource.Max != nil { - if *resource.Max != *other.Max { - return false - } - } - if resource.MaxDataPoints == nil && other.MaxDataPoints != nil || resource.MaxDataPoints != nil && other.MaxDataPoints == nil { - return false - } - - if resource.MaxDataPoints != nil { - if *resource.MaxDataPoints != *other.MaxDataPoints { - return false - } - } - if resource.Min == nil && other.Min != nil || resource.Min != nil && other.Min == nil { - return false - } - - if resource.Min != nil { - if *resource.Min != *other.Min { - return false - } - } - if resource.Nodes == nil && other.Nodes != nil || resource.Nodes != nil && other.Nodes == nil { - return false - } - - if resource.Nodes != nil { - if !resource.Nodes.Equals(*other.Nodes) { - return false - } - } - if resource.Noise == nil && other.Noise != nil || resource.Noise != nil && other.Noise == nil { - return false - } - - if resource.Noise != nil { - if *resource.Noise != *other.Noise { - return false - } - } - - if len(resource.Points) != len(other.Points) { - return false - } - - for i1 := range resource.Points { - - if len(resource.Points[i1]) != len(other.Points[i1]) { - return false - } - - for i2 := range resource.Points[i1] { - // is DeepEqual good enough here? - if !reflect.DeepEqual(resource.Points[i1][i2], other.Points[i1][i2]) { - return false - } - } - } - if resource.PulseWave == nil && other.PulseWave != nil || resource.PulseWave != nil && other.PulseWave == nil { - return false - } - - if resource.PulseWave != nil { - if !resource.PulseWave.Equals(*other.PulseWave) { - return false - } - } - if resource.QueryType == nil && other.QueryType != nil || resource.QueryType != nil && other.QueryType == nil { - return false - } - - if resource.QueryType != nil { - if *resource.QueryType != *other.QueryType { - return false - } - } - if resource.RawFrameContent == nil && other.RawFrameContent != nil || resource.RawFrameContent != nil && other.RawFrameContent == nil { - return false - } - - if resource.RawFrameContent != nil { - if *resource.RawFrameContent != *other.RawFrameContent { - return false - } - } - if resource.RefId == nil && other.RefId != nil || resource.RefId != nil && other.RefId == nil { - return false - } - - if resource.RefId != nil { - if *resource.RefId != *other.RefId { - return false - } - } - if resource.ResultAssertions == nil && other.ResultAssertions != nil || resource.ResultAssertions != nil && other.ResultAssertions == nil { - return false - } - - if resource.ResultAssertions != nil { - if !resource.ResultAssertions.Equals(*other.ResultAssertions) { - return false - } - } - if resource.ScenarioId == nil && other.ScenarioId != nil || resource.ScenarioId != nil && other.ScenarioId == nil { - return false - } - - if resource.ScenarioId != nil { - if *resource.ScenarioId != *other.ScenarioId { - return false - } - } - if resource.SeriesCount == nil && other.SeriesCount != nil || resource.SeriesCount != nil && other.SeriesCount == nil { - return false - } - - if resource.SeriesCount != nil { - if *resource.SeriesCount != *other.SeriesCount { - return false - } - } - if resource.Sim == nil && other.Sim != nil || resource.Sim != nil && other.Sim == nil { - return false - } - - if resource.Sim != nil { - if !resource.Sim.Equals(*other.Sim) { - return false - } - } - if resource.SpanCount == nil && other.SpanCount != nil || resource.SpanCount != nil && other.SpanCount == nil { - return false - } - - if resource.SpanCount != nil { - if *resource.SpanCount != *other.SpanCount { - return false - } - } - if resource.Spread == nil && other.Spread != nil || resource.Spread != nil && other.Spread == nil { - return false - } - - if resource.Spread != nil { - if *resource.Spread != *other.Spread { - return false - } - } - if resource.StartValue == nil && other.StartValue != nil || resource.StartValue != nil && other.StartValue == nil { - return false - } - - if resource.StartValue != nil { - if *resource.StartValue != *other.StartValue { - return false - } - } - if resource.Stream == nil && other.Stream != nil || resource.Stream != nil && other.Stream == nil { - return false - } - - if resource.Stream != nil { - if !resource.Stream.Equals(*other.Stream) { - return false - } - } - if resource.StringInput == nil && other.StringInput != nil || resource.StringInput != nil && other.StringInput == nil { - return false - } - - if resource.StringInput != nil { - if *resource.StringInput != *other.StringInput { - return false - } - } - if resource.TimeRange == nil && other.TimeRange != nil || resource.TimeRange != nil && other.TimeRange == nil { - return false - } - - if resource.TimeRange != nil { - if !resource.TimeRange.Equals(*other.TimeRange) { - return false - } - } - if resource.Usa == nil && other.Usa != nil || resource.Usa != nil && other.Usa == nil { - return false - } - - if resource.Usa != nil { - if !resource.Usa.Equals(*other.Usa) { - return false - } - } - if resource.WithNil == nil && other.WithNil != nil || resource.WithNil != nil && other.WithNil == nil { - return false - } - - if resource.WithNil != nil { - if *resource.WithNil != *other.WithNil { - return false - } - } - - return true -} - -type NodesQueryType string - -const ( - NodesQueryTypeRandom NodesQueryType = "random" - NodesQueryTypeRandomEdges NodesQueryType = "random edges" - NodesQueryTypeResponseMedium NodesQueryType = "response_medium" - NodesQueryTypeResponseSmall NodesQueryType = "response_small" - NodesQueryTypeFeatureShowcase NodesQueryType = "feature_showcase" -) - -type ResultAssertionsType string - -const ( - ResultAssertionsTypeNone ResultAssertionsType = "" - ResultAssertionsTypeTimeseriesWide ResultAssertionsType = "timeseries-wide" - ResultAssertionsTypeTimeseriesLong ResultAssertionsType = "timeseries-long" - ResultAssertionsTypeTimeseriesMany ResultAssertionsType = "timeseries-many" - ResultAssertionsTypeTimeseriesMulti ResultAssertionsType = "timeseries-multi" - ResultAssertionsTypeDirectoryListing ResultAssertionsType = "directory-listing" - ResultAssertionsTypeTable ResultAssertionsType = "table" - ResultAssertionsTypeNumericWide ResultAssertionsType = "numeric-wide" - ResultAssertionsTypeNumericMulti ResultAssertionsType = "numeric-multi" - ResultAssertionsTypeNumericLong ResultAssertionsType = "numeric-long" - ResultAssertionsTypeLogLines ResultAssertionsType = "log-lines" -) - -type StreamingQueryType string - -const ( - StreamingQueryTypeFetch StreamingQueryType = "fetch" - StreamingQueryTypeLogs StreamingQueryType = "logs" - StreamingQueryTypeSignal StreamingQueryType = "signal" - StreamingQueryTypeTraces StreamingQueryType = "traces" -) - -type DataqueryErrorType string - -const ( - DataqueryErrorTypeFrontendException DataqueryErrorType = "frontend_exception" - DataqueryErrorTypeFrontendObservable DataqueryErrorType = "frontend_observable" - DataqueryErrorTypeServerPanic DataqueryErrorType = "server_panic" -) - -type DataqueryScenarioId string - -const ( - DataqueryScenarioIdAnnotations DataqueryScenarioId = "annotations" - DataqueryScenarioIdArrow DataqueryScenarioId = "arrow" - DataqueryScenarioIdCsvContent DataqueryScenarioId = "csv_content" - DataqueryScenarioIdCsvFile DataqueryScenarioId = "csv_file" - DataqueryScenarioIdCsvMetricValues DataqueryScenarioId = "csv_metric_values" - DataqueryScenarioIdDatapointsOutsideRange DataqueryScenarioId = "datapoints_outside_range" - DataqueryScenarioIdExponentialHeatmapBucketData DataqueryScenarioId = "exponential_heatmap_bucket_data" - DataqueryScenarioIdFlameGraph DataqueryScenarioId = "flame_graph" - DataqueryScenarioIdGrafanaApi DataqueryScenarioId = "grafana_api" - DataqueryScenarioIdLinearHeatmapBucketData DataqueryScenarioId = "linear_heatmap_bucket_data" - DataqueryScenarioIdLive DataqueryScenarioId = "live" - DataqueryScenarioIdLogs DataqueryScenarioId = "logs" - DataqueryScenarioIdManualEntry DataqueryScenarioId = "manual_entry" - DataqueryScenarioIdNoDataPoints DataqueryScenarioId = "no_data_points" - DataqueryScenarioIdNodeGraph DataqueryScenarioId = "node_graph" - DataqueryScenarioIdPredictableCsvWave DataqueryScenarioId = "predictable_csv_wave" - DataqueryScenarioIdPredictablePulse DataqueryScenarioId = "predictable_pulse" - DataqueryScenarioIdRandomWalk DataqueryScenarioId = "random_walk" - DataqueryScenarioIdRandomWalkTable DataqueryScenarioId = "random_walk_table" - DataqueryScenarioIdRandomWalkWithError DataqueryScenarioId = "random_walk_with_error" - DataqueryScenarioIdRawFrame DataqueryScenarioId = "raw_frame" - DataqueryScenarioIdServerError500 DataqueryScenarioId = "server_error_500" - DataqueryScenarioIdSimulation DataqueryScenarioId = "simulation" - DataqueryScenarioIdSlowQuery DataqueryScenarioId = "slow_query" - DataqueryScenarioIdStreamingClient DataqueryScenarioId = "streaming_client" - DataqueryScenarioIdTableStatic DataqueryScenarioId = "table_static" - DataqueryScenarioIdTrace DataqueryScenarioId = "trace" - DataqueryScenarioIdUsa DataqueryScenarioId = "usa" - DataqueryScenarioIdVariablesQuery DataqueryScenarioId = "variables-query" -) diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/usaquery_builder_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/usaquery_builder_gen.go deleted file mode 100644 index 67a14cdaebf84..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/usaquery_builder_gen.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -var _ cog.Builder[USAQuery] = (*USAQueryBuilder)(nil) - -type USAQueryBuilder struct { - internal *USAQuery - errors map[string]cog.BuildErrors -} - -func NewUSAQueryBuilder() *USAQueryBuilder { - resource := &USAQuery{} - builder := &USAQueryBuilder{ - internal: resource, - errors: make(map[string]cog.BuildErrors), - } - - builder.applyDefaults() - - return builder -} - -func (builder *USAQueryBuilder) Build() (USAQuery, error) { - var errs cog.BuildErrors - - for _, err := range builder.errors { - errs = append(errs, cog.MakeBuildErrors("USAQuery", err)...) - } - - if len(errs) != 0 { - return USAQuery{}, errs - } - - return *builder.internal, nil -} - -func (builder *USAQueryBuilder) Fields(fields []string) *USAQueryBuilder { - builder.internal.Fields = fields - - return builder -} - -func (builder *USAQueryBuilder) Mode(mode string) *USAQueryBuilder { - builder.internal.Mode = &mode - - return builder -} - -func (builder *USAQueryBuilder) Period(period string) *USAQueryBuilder { - builder.internal.Period = &period - - return builder -} - -func (builder *USAQueryBuilder) States(states []string) *USAQueryBuilder { - builder.internal.States = states - - return builder -} - -func (builder *USAQueryBuilder) applyDefaults() { -} diff --git a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/usaquery_converter_gen.go b/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/usaquery_converter_gen.go deleted file mode 100644 index 3092d2e69cf49..0000000000000 --- a/vendor/github.com/grafana/grafana-foundation-sdk/go/testdata/usaquery_converter_gen.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated - EDITING IS FUTILE. DO NOT EDIT. - -package testdata - -import ( - "fmt" - "strings" - - cog "github.com/grafana/grafana-foundation-sdk/go/cog" -) - -func USAQueryConverter(input USAQuery) string { - calls := []string{ - `testdata.NewUSAQueryBuilder()`, - } - var buffer strings.Builder - if input.Fields != nil && len(input.Fields) >= 1 { - - buffer.WriteString(`Fields(`) - tmparg0 := []string{} - for _, arg1 := range input.Fields { - tmpfieldsarg1 := fmt.Sprintf("%#v", arg1) - tmparg0 = append(tmparg0, tmpfieldsarg1) - } - arg0 := "[]string{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Mode != nil && *input.Mode != "" { - - buffer.WriteString(`Mode(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Mode)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.Period != nil && *input.Period != "" { - - buffer.WriteString(`Period(`) - arg0 := fmt.Sprintf("%#v", cog.Unptr(input.Period)) - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - if input.States != nil && len(input.States) >= 1 { - - buffer.WriteString(`States(`) - tmparg0 := []string{} - for _, arg1 := range input.States { - tmpstatesarg1 := fmt.Sprintf("%#v", arg1) - tmparg0 = append(tmparg0, tmpstatesarg1) - } - arg0 := "[]string{" + strings.Join(tmparg0, ",\n") + "}" - buffer.WriteString(arg0) - - buffer.WriteString(")") - - calls = append(calls, buffer.String()) - buffer.Reset() - - } - - return strings.Join(calls, ".\t\n") -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 101a394a443e9..56aaee642b255 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1044,8 +1044,6 @@ github.com/grafana/grafana-foundation-sdk/go/cog/variants github.com/grafana/grafana-foundation-sdk/go/common github.com/grafana/grafana-foundation-sdk/go/dashboard github.com/grafana/grafana-foundation-sdk/go/prometheus -github.com/grafana/grafana-foundation-sdk/go/table -github.com/grafana/grafana-foundation-sdk/go/testdata github.com/grafana/grafana-foundation-sdk/go/text github.com/grafana/grafana-foundation-sdk/go/timeseries # github.com/grafana/jsonparser v0.0.0-20241004153430-023329977675