Documentation ¶
Index ¶
- Constants
- Variables
- type AnnotationEvent
- type AnnotationsDto
- type AnnotationsQueryDTO
- type DashAnnotation
- type EmailDTO
- type Metrics
- type PublicDashboard
- type PublicDashboardDTO
- type PublicDashboardErr
- type PublicDashboardListQuery
- type PublicDashboardListResponse
- type PublicDashboardListResponseWithPagination
- type PublicDashboardQueryDTO
- type SavePublicDashboardCommand
- type SavePublicDashboardDTO
- type ShareType
- type TimeRangeDTO
- type TimeSettings
- type TotalPublicDashboard
Constants ¶
View Source
const ( QuerySuccess = "success" QueryFailure = "failure" )
Variables ¶
View Source
var ( ErrInternalServerError = errutil.NewBase(errutil.StatusInternal, "publicdashboards.internalServerError", errutil.WithPublicMessage("Internal server error")) ErrPublicDashboardNotFound = errutil.NewBase(errutil.StatusNotFound, "publicdashboards.notFound", errutil.WithPublicMessage("Public dashboard not found")) ErrDashboardNotFound = errutil.NewBase(errutil.StatusNotFound, "publicdashboards.dashboardNotFound", errutil.WithPublicMessage("Dashboard not found")) ErrPanelNotFound = errutil.NewBase(errutil.StatusNotFound, "publicdashboards.panelNotFound", errutil.WithPublicMessage("Public dashboard panel not found")) ErrBadRequest = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.badRequest") ErrPanelQueriesNotFound = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.panelQueriesNotFound", errutil.WithPublicMessage("Failed to extract queries from panel")) ErrInvalidAccessToken = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.invalidAccessToken", errutil.WithPublicMessage("Invalid access token")) ErrInvalidPanelId = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.invalidPanelId", errutil.WithPublicMessage("Invalid panel id")) ErrInvalidUid = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.invalidUid", errutil.WithPublicMessage("Invalid Uid")) ErrPublicDashboardIdentifierNotSet = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.identifierNotSet", errutil.WithPublicMessage("No Uid for public dashboard specified")) ErrPublicDashboardHasTemplateVariables = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.hasTemplateVariables", errutil.WithPublicMessage("Public dashboard has template variables")) ErrInvalidInterval = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.invalidInterval", errutil.WithPublicMessage("intervalMS should be greater than 0")) ErrInvalidMaxDataPoints = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.maxDataPoints", errutil.WithPublicMessage("maxDataPoints should be greater than 0")) ErrInvalidTimeRange = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.invalidTimeRange", errutil.WithPublicMessage("Invalid time range")) ErrDashboardIsPublic = errutil.NewBase(errutil.StatusBadRequest, "publicdashboards.dashboardIsPublic", errutil.WithPublicMessage("Dashboard is already public")) ErrPublicDashboardNotEnabled = errutil.NewBase(errutil.StatusForbidden, "publicdashboards.notEnabled", errutil.WithPublicMessage("Public dashboard paused")) )
View Source
var ( QueryResultStatuses = []string{QuerySuccess, QueryFailure} )
Functions ¶
This section is empty.
Types ¶
type AnnotationEvent ¶
type AnnotationEvent struct { Id int64 `json:"id"` DashboardId int64 `json:"dashboardId"` PanelId int64 `json:"panelId"` Tags []string `json:"tags"` IsRegion bool `json:"isRegion"` Text string `json:"text"` Color string `json:"color"` Time int64 `json:"time"` TimeEnd int64 `json:"timeEnd"` Source dashboard.AnnotationQuery `json:"source"` }
type AnnotationsDto ¶
type AnnotationsDto struct { Annotations struct { List []DashAnnotation `json:"list"` } }
type AnnotationsQueryDTO ¶
type Metrics ¶
type Metrics struct {
TotalPublicDashboards []*TotalPublicDashboard
}
type PublicDashboard ¶
type PublicDashboard struct { Uid string `json:"uid" xorm:"pk uid"` DashboardUid string `json:"dashboardUid" xorm:"dashboard_uid"` OrgId int64 `json:"-" xorm:"org_id"` // Don't ever marshal orgId to Json AccessToken string `json:"accessToken" xorm:"access_token"` CreatedBy int64 `json:"createdBy" xorm:"created_by"` UpdatedBy int64 `json:"updatedBy" xorm:"updated_by"` CreatedAt time.Time `json:"createdAt" xorm:"created_at"` UpdatedAt time.Time `json:"updatedAt" xorm:"updated_at"` //config fields TimeSettings *TimeSettings `json:"-" xorm:"time_settings"` TimeSelectionEnabled bool `json:"timeSelectionEnabled" xorm:"time_selection_enabled"` IsEnabled bool `json:"isEnabled" xorm:"is_enabled"` AnnotationsEnabled bool `json:"annotationsEnabled" xorm:"annotations_enabled"` Recipients []EmailDTO `json:"recipients,omitempty" xorm:"-"` }
func (PublicDashboard) TableName ¶
func (pd PublicDashboard) TableName() string
type PublicDashboardDTO ¶
type PublicDashboardErr ¶
PublicDashboardErr represents a dashboard error.
func (PublicDashboardErr) Error ¶
func (e PublicDashboardErr) Error() string
Error returns the error message.
type PublicDashboardListResponseWithPagination ¶
type PublicDashboardListResponseWithPagination struct { PublicDashboards []*PublicDashboardListResponse `json:"publicDashboards"` TotalCount int64 `json:"totalCount"` Page int `json:"page"` PerPage int `json:"perPage"` }
type PublicDashboardQueryDTO ¶
type PublicDashboardQueryDTO struct { IntervalMs int64 MaxDataPoints int64 QueryCachingTTL int64 TimeRange TimeRangeDTO }
type SavePublicDashboardCommand ¶
type SavePublicDashboardCommand struct {
PublicDashboard PublicDashboard
}
type SavePublicDashboardDTO ¶
type SavePublicDashboardDTO struct { Uid string DashboardUid string OrgID int64 UserId int64 PublicDashboard *PublicDashboardDTO }
DTO for transforming user input in the api
type TimeRangeDTO ¶
type TimeSettings ¶
func (*TimeSettings) FromDB ¶
func (ts *TimeSettings) FromDB(data []byte) error
func (*TimeSettings) ToDB ¶
func (ts *TimeSettings) ToDB() ([]byte, error)
type TotalPublicDashboard ¶
Click to show internal directories.
Click to hide internal directories.