mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* PanelLibrary: Adds delete * Chore: fixes some comments * Chore: changes after PR comments * Refactor: deletes from correct org
39 lines
997 B
Go
39 lines
997 B
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"`
|
|
Title 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 title 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
|
|
|
|
// addLibraryPanelCommand is the command for adding a LibraryPanel
|
|
type addLibraryPanelCommand struct {
|
|
FolderID int64 `json:"folderId"`
|
|
Title string `json:"title"`
|
|
Model json.RawMessage `json:"model"`
|
|
}
|