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" FeaturePublicDashboardsEmailSharing = "publicDashboardsEmailSharing" )
Variables ¶
View Source
var ( ErrInternalServerError = errutil.Internal("publicdashboards.internalServerError", errutil.WithPublicMessage("Internal server error")) ErrPublicDashboardNotFound = errutil.NotFound("publicdashboards.notFound", errutil.WithPublicMessage("Public dashboard not found")) ErrDashboardNotFound = errutil.NotFound("publicdashboards.dashboardNotFound", errutil.WithPublicMessage("Dashboard not found")) ErrPanelNotFound = errutil.NotFound("publicdashboards.panelNotFound", errutil.WithPublicMessage("Public dashboard panel not found")) ErrBadRequest = errutil.BadRequest("publicdashboards.badRequest") ErrPanelQueriesNotFound = errutil.BadRequest("publicdashboards.panelQueriesNotFound", errutil.WithPublicMessage("Failed to extract queries from panel")) ErrInvalidAccessToken = errutil.BadRequest("publicdashboards.invalidAccessToken", errutil.WithPublicMessage("Invalid access token")) ErrInvalidPanelId = errutil.BadRequest("publicdashboards.invalidPanelId", errutil.WithPublicMessage("Invalid panel id")) ErrInvalidUid = errutil.BadRequest("publicdashboards.invalidUid", errutil.WithPublicMessage("Invalid Uid")) ErrPublicDashboardIdentifierNotSet = errutil.BadRequest("publicdashboards.identifierNotSet", errutil.WithPublicMessage("No Uid for public dashboard specified")) ErrPublicDashboardHasTemplateVariables = errutil.BadRequest("publicdashboards.hasTemplateVariables", errutil.WithPublicMessage("Public dashboard has template variables")) ErrInvalidInterval = errutil.BadRequest("publicdashboards.invalidInterval", errutil.WithPublicMessage("intervalMS should be greater than 0")) ErrInvalidMaxDataPoints = errutil.BadRequest("publicdashboards.maxDataPoints", errutil.WithPublicMessage("maxDataPoints should be greater than 0")) ErrInvalidTimeRange = errutil.BadRequest("publicdashboards.invalidTimeRange", errutil.WithPublicMessage("Invalid time range")) ErrDashboardIsPublic = errutil.BadRequest("publicdashboards.dashboardIsPublic", errutil.WithPublicMessage("Dashboard is already public")) ErrPublicDashboardUidExists = errutil.BadRequest("publicdashboards.uidExists", errutil.WithPublicMessage("Public Dashboard Uid already exists")) ErrPublicDashboardAccessTokenExists = errutil.BadRequest("publicdashboards.accessTokenExists", errutil.WithPublicMessage("Public Dashboard Access Token already exists")) ErrPublicDashboardNotEnabled = errutil.Forbidden("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 PublicDashboardListResponse ¶
type PublicDashboardListResponse struct { Uid string `json:"uid" xorm:"uid"` AccessToken string `json:"accessToken" xorm:"access_token"` Title string `json:"title" xorm:"title"` DashboardUid string `json:"dashboardUid" xorm:"dashboard_uid"` IsEnabled bool `json:"isEnabled" xorm:"is_enabled"` Slug string `json:"slug" xorm:"slug"` }
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.