Documentation
¶
Index ¶
- type CreateLibraryElementParams
- type DeleteLibraryElementByUIDParams
- type FolderFilter
- type GetLibraryElementByUIDParams
- type GetLibraryElementConnectionsParams
- type GetLibraryElementConnectionsResponse
- type GetLibraryElementResponse
- type GetLibraryElementsParams
- type GetLibraryElementsResponse
- type LibraryElementByNameParams
- type LibraryElementByUID
- type LibraryElementService
- func (l *LibraryElementService) ConnectElementsToDashboard(c context.Context, signedInUser *user.SignedInUser, elementUIDs []string, ...) error
- func (l *LibraryElementService) CreateElement(c context.Context, signedInUser *user.SignedInUser, ...) (model.LibraryElementDTO, error)
- func (l *LibraryElementService) DeleteLibraryElementsInFolder(c context.Context, signedInUser *user.SignedInUser, folderUID string) error
- func (l *LibraryElementService) DisconnectElementsFromDashboard(c context.Context, dashboardID int64) error
- func (l *LibraryElementService) GetElement(c context.Context, signedInUser *user.SignedInUser, UID string) (model.LibraryElementDTO, error)
- func (l *LibraryElementService) GetElementsForDashboard(c context.Context, dashboardID int64) (map[string]model.LibraryElementDTO, error)
- type Pair
- type Service
- type UpdateLibraryElementParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateLibraryElementParams ¶
type CreateLibraryElementParams struct {
// in:body
// required:true
Body model.CreateLibraryElementCommand `json:"body"`
}
swagger:parameters createLibraryElement
type DeleteLibraryElementByUIDParams ¶
type DeleteLibraryElementByUIDParams struct {
// in:path
// required:true
UID string `json:"library_element_uid"`
}
swagger:parameters deleteLibraryElementByUID
type FolderFilter ¶
type FolderFilter struct {
// contains filtered or unexported fields
}
type GetLibraryElementByUIDParams ¶
type GetLibraryElementByUIDParams struct {
// in:path
// required:true
UID string `json:"library_element_uid"`
}
swagger:parameters getLibraryElementByUID
type GetLibraryElementConnectionsParams ¶
type GetLibraryElementConnectionsParams struct {
// in:path
// required:true
UID string `json:"library_element_uid"`
}
swagger:parameters GetLibraryElementConnectionsParams
type GetLibraryElementConnectionsResponse ¶
type GetLibraryElementConnectionsResponse struct {
// in: body
Body model.LibraryElementConnectionsResponse `json:"body"`
}
swagger:response getLibraryElementConnectionsResponse
type GetLibraryElementResponse ¶
type GetLibraryElementResponse struct {
// in: body
Body model.LibraryElementResponse `json:"body"`
}
swagger:response getLibraryElementResponse
type GetLibraryElementsParams ¶
type GetLibraryElementsParams struct {
// Part of the name or description searched for.
// in:query
// required:false
SearchString string `json:"searchString"`
// Kind of element to search for.
// in:query
// required:false
// Description:
// * 1 - library panels
// * 2 - library variables
// enum: 1,2
Kind int `json:"kind"`
// Sort order of elements.
// in:query
// required:false
// Description:
// * alpha-asc: ascending
// * alpha-desc: descending
// Enum: alpha-asc,alpha-desc
SortDirection string `json:"sortDirection"`
// A comma separated list of types to filter the elements by
// in:query
// required:false
TypeFilter string `json:"typeFilter"`
// Element UID to exclude from search results.
// in:query
// required:false
ExcludeUID string `json:"excludeUid"`
// A comma separated list of folder ID(s) to filter the elements by.
// in:query
// required:false
FolderFilter string `json:"folderFilter"`
// The number of results per page.
// in:query
// required:false
// default: 100
PerPage int `json:"perPage"`
// The page for a set of records, given that only perPage records are returned at a time. Numbering starts at 1.
// in:query
// required:false
// default: 1
Page int `json:"page"`
}
swagger:parameters getLibraryElements
type GetLibraryElementsResponse ¶
type GetLibraryElementsResponse struct {
// in: body
Body model.LibraryElementSearchResponse `json:"body"`
}
swagger:response getLibraryElementsResponse
type LibraryElementByNameParams ¶
type LibraryElementByNameParams struct {
// in:path
// required:true
Name string `json:"library_element_name"`
}
swagger:parameters getLibraryElementByName
type LibraryElementByUID ¶
type LibraryElementByUID struct {
// in:path
// required:true
UID string `json:"library_element_uid"`
}
swagger:parameters getLibraryElementByUID getLibraryElementConnections
type LibraryElementService ¶
type LibraryElementService struct {
Cfg *setting.Cfg
SQLStore db.DB
RouteRegister routing.RouteRegister
// contains filtered or unexported fields
}
LibraryElementService is the service for the Library Element feature.
func ProvideService ¶
func ProvideService(cfg *setting.Cfg, sqlStore db.DB, routeRegister routing.RouteRegister, folderService folder.Service, features featuremgmt.FeatureToggles) *LibraryElementService
func (*LibraryElementService) ConnectElementsToDashboard ¶
func (l *LibraryElementService) ConnectElementsToDashboard(c context.Context, signedInUser *user.SignedInUser, elementUIDs []string, dashboardID int64) error
ConnectElementsToDashboard connects elements to a specific dashboard.
func (*LibraryElementService) CreateElement ¶
func (l *LibraryElementService) CreateElement(c context.Context, signedInUser *user.SignedInUser, cmd model.CreateLibraryElementCommand) (model.LibraryElementDTO, error)
CreateElement creates a Library Element.
func (*LibraryElementService) DeleteLibraryElementsInFolder ¶
func (l *LibraryElementService) DeleteLibraryElementsInFolder(c context.Context, signedInUser *user.SignedInUser, folderUID string) error
DeleteLibraryElementsInFolder deletes all elements for a specific folder.
func (*LibraryElementService) DisconnectElementsFromDashboard ¶
func (l *LibraryElementService) DisconnectElementsFromDashboard(c context.Context, dashboardID int64) error
DisconnectElementsFromDashboard disconnects elements from a specific dashboard.
func (*LibraryElementService) GetElement ¶
func (l *LibraryElementService) GetElement(c context.Context, signedInUser *user.SignedInUser, UID string) (model.LibraryElementDTO, error)
GetElement gets an element from a UID.
func (*LibraryElementService) GetElementsForDashboard ¶
func (l *LibraryElementService) GetElementsForDashboard(c context.Context, dashboardID int64) (map[string]model.LibraryElementDTO, error)
GetElementsForDashboard gets all connected elements for a specific dashboard.
type Service ¶
type Service interface {
CreateElement(c context.Context, signedInUser *user.SignedInUser, cmd model.CreateLibraryElementCommand) (model.LibraryElementDTO, error)
GetElement(c context.Context, signedInUser *user.SignedInUser, UID string) (model.LibraryElementDTO, error)
GetElementsForDashboard(c context.Context, dashboardID int64) (map[string]model.LibraryElementDTO, error)
ConnectElementsToDashboard(c context.Context, signedInUser *user.SignedInUser, elementUIDs []string, dashboardID int64) error
DisconnectElementsFromDashboard(c context.Context, dashboardID int64) error
DeleteLibraryElementsInFolder(c context.Context, signedInUser *user.SignedInUser, folderUID string) error
}
Service is a service for operating on library elements.
type UpdateLibraryElementParam ¶
type UpdateLibraryElementParam struct {
// in:body
// required:true
Body model.PatchLibraryElementCommand `json:"body"`
// in:path
// required:true
UID string `json:"library_element_uid"`
}
swagger:parameters updateLibraryElement