Skip to content

Commit

Permalink
Change to json.RawMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
v-zhuravlev committed Nov 5, 2024
1 parent f9f68b7 commit fe23dd3
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,19 @@ func (a *Annotation) GetDataSource() (Datasource, error) {
// Panel is a deliberately incomplete representation of the Dashboard -> Panel type in grafana.
// The properties which are extracted from JSON are only those used for linting purposes.
type Panel struct {
Id int `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Targets []Target `json:"targets,omitempty"`
Datasource interface{} `json:"datasource,omitempty"`
Type string `json:"type"`
Panels []Panel `json:"panels,omitempty"`
FieldConfig *FieldConfig `json:"fieldConfig,omitempty"`
Options []byte `json:"options,omitempty"`
Id int `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Targets []Target `json:"targets,omitempty"`
Datasource interface{} `json:"datasource,omitempty"`
Type string `json:"type"`
Panels []Panel `json:"panels,omitempty"`
FieldConfig *FieldConfig `json:"fieldConfig,omitempty"`
Options json.RawMessage `json:"options,omitempty"`
}

// oversimplified stat panel options
// Stat panel options is a deliberately incomplete representation of the stat panel options from grafana.
// The properties which are extracted from JSON are only those used for linting purposes.
type StatOptions struct {
ReduceOptions ReduceOptions `json:"reduceOptions,omitempty"`
}
Expand All @@ -219,7 +220,7 @@ type ReduceOptions struct {
}

type FieldConfig struct {
Defaults dashboard.FieldConfig
Defaults dashboard.FieldConfig
Overrides []dashboard.DashboardFieldConfigSourceOverrides
}

Expand Down

0 comments on commit fe23dd3

Please sign in to comment.