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

52 lines
975 B

package models
import (
"errors"
"time"
)
// Typed errors
var (
ErrPreferencesNotFound = errors.New("Preferences not found")
)
type Preferences struct {
Id int64
OrgId int64
UserId int64
Version int
Preference map[string]interface{}
Created time.Time
Updated time.Time
}
// ---------------------
// QUERIES
type GetPreferencesQuery struct {
Id int64
OrgId int64
UserId int64
Result *Preferences
}
// ---------------------
// COMMANDS
type SavePreferencesCommand struct {
Preference map[string]interface{} `json:"Preference" binding:"Required"`
UserId int64 `json:"-"`
OrgId int64 `json:"-"`
}
// ----------------------
// DTO & Projections
type PreferencesDTO struct {
Id int64 `json:"Id"`
UserId int64 `json:"UserId"`
OrgId int64 `json:"OrgId"`
Preference map[string]interface{} `json:"Preference"`
}