The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/pkg/models/preferences.go

46 lines
831 B

package models
import (
"errors"
)
// Typed errors
var (
ErrPreferenceNotFound = errors.New("Preference not found")
)
type Preferences struct {
Id int64
PrefId int64
PrefType string
PrefData map[string]interface{}
}
// ---------------------
// QUERIES
type GetPreferencesQuery struct {
PrefId int64
PrefType string
Result PreferencesDTO
}
// ---------------------
// COMMANDS
type SavePreferencesCommand struct {
PrefData map[string]interface{} `json:"prefData" binding:"Required"`
PrefId int64 `json:"-"`
PrefType string `json:"-"`
}
// ----------------------
// DTO & Projections
type PreferencesDTO struct {
PrefId int64 `json:"prefId"`
PrefType string `json:"prefType"`
PrefData map[string]interface{} `json:"prefData"`
}