Documentation ¶
Index ¶
- Constants
- Variables
- type AnnotationEvent
- type AnnotationsDto
- type AnnotationsQueryDTO
- type DashAnnotation
- type EmailDTO
- type PublicDashboard
- type PublicDashboardErr
- type PublicDashboardListResponse
- type PublicDashboardQueryDTO
- type SavePublicDashboardCommand
- type SavePublicDashboardDTO
- type ShareType
- type TimeSettings
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")) 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 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 TimeSettings *TimeSettings `json:"timeSettings" xorm:"time_settings"` IsEnabled bool `json:"isEnabled" xorm:"is_enabled"` AccessToken string `json:"accessToken" xorm:"access_token"` AnnotationsEnabled bool `json:"annotationsEnabled" xorm:"annotations_enabled"` TimeSelectionEnabled bool `json:"timeSelectionEnabled" xorm:"time_selection_enabled"` Recipients []EmailDTO `json:"recipients,omitempty" xorm:"-"` 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"` }
func (PublicDashboard) BuildTimeSettings ¶
func (pd PublicDashboard) BuildTimeSettings(dashboard *dashboards.Dashboard, reqDTO PublicDashboardQueryDTO) TimeSettings
BuildTimeSettings build time settings object using selected values if enabled and are valid or dashboard default values
func (PublicDashboard) TableName ¶
func (pd PublicDashboard) TableName() string
type PublicDashboardErr ¶
PublicDashboardErr represents a dashboard error.
func (PublicDashboardErr) Error ¶
func (e PublicDashboardErr) Error() string
Error returns the error message.
type PublicDashboardQueryDTO ¶
type PublicDashboardQueryDTO struct { IntervalMs int64 MaxDataPoints int64 QueryCachingTTL int64 TimeRange TimeSettings }
type SavePublicDashboardCommand ¶
type SavePublicDashboardCommand struct {
PublicDashboard PublicDashboard
}
type SavePublicDashboardDTO ¶
type SavePublicDashboardDTO struct { DashboardUid string OrgId int64 UserId int64 PublicDashboard *PublicDashboard }
DTO for transforming user input in the api
type TimeSettings ¶
func (*TimeSettings) FromDB ¶
func (ts *TimeSettings) FromDB(data []byte) error
func (*TimeSettings) ToDB ¶
func (ts *TimeSettings) ToDB() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.