mirror of
https://github.com/grafana/grafana.git
synced 2025-01-26 08:16:59 -06:00
35a755fe50
* PanelLibrary: Adds uid and renames title to name * Chore: removing lines * Chore: updates comments * Chore: changes after PR comments
40 lines
1.0 KiB
Go
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"`
|
|
}
|