grafana/pkg/services/librarypanels/models.go
Hugo Häggmark 35a755fe50
PanelLibrary: Adds uid and renames title to name (#29944)
* PanelLibrary: Adds uid and renames title to name

* Chore: removing lines

* Chore: updates comments

* Chore: changes after PR comments
2020-12-22 12:00:41 +01:00

40 lines
1.0 KiB
Go

package librarypanels
import (
"encoding/json"
"errors"
"time"
)
// LibraryPanel is the model for library panel definitions.
type LibraryPanel struct {
ID int64 `xorm:"pk autoincr 'id'"`
OrgID int64 `xorm:"org_id"`
FolderID int64 `xorm:"folder_id"`
UID string `xorm:"uid"`
Name string
Model json.RawMessage
Created time.Time
Updated time.Time
CreatedBy int64
UpdatedBy int64
}
var (
// errLibraryPanelAlreadyAdded is an error for when the user tries to add a library panel that already exists.
errLibraryPanelAlreadyAdded = errors.New("library panel with that name already exists")
// errLibraryPanelNotFound is an error for when a library panel can't be found.
errLibraryPanelNotFound = errors.New("library panel could not be found")
)
// Commands
// createLibraryPanelCommand is the command for adding a LibraryPanel
type createLibraryPanelCommand struct {
FolderID int64 `json:"folderId"`
Name string `json:"name"`
Model json.RawMessage `json:"model"`
}