Files
grafana/pkg/services/librarypanels/models.go
Hugo Häggmark 47afe1fa42 PanelLibrary: Adds delete Api (#29741)
* PanelLibrary: Adds delete

* Chore: fixes some comments

* Chore: changes after PR comments

* Refactor: deletes from correct org
2020-12-11 06:08:32 +01:00

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"`
}