Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsTag(existingTags []*Tag, tag *Tag) bool
- func IsKnownDataSourcePlugin(dsType string) bool
- func JoinTagPairs(tags []*Tag) []string
- type AddApiKeyCommand
- type AddDataSourceCommand
- type AddOrgUserCommand
- type Address
- type AdminStats
- type Alert
- type AlertNotification
- type AlertSeverityType
- type AlertStateInfoDTO
- type AlertStateType
- type AlertingClusterInfo
- type ApiKey
- type ApiKeyDTO
- type ChangeUserPasswordCommand
- type CreateAlertNotificationCommand
- type CreateDashboardSnapshotCommand
- type CreateOrgCommand
- type CreatePlaylistCommand
- type CreateTempUserCommand
- type CreateUserCommand
- type Dashboard
- type DashboardSnapshot
- type DashboardSnapshotDTO
- type DashboardSnapshots
- type DashboardSnapshotsList
- type DashboardTagCloudItem
- type DashboardVersion
- type DashboardVersionDTO
- type DashboardVersionMeta
- type DataSource
- type DataSourceCreatedEvent
- type DataSourceStats
- type DeleteAlertCommand
- type DeleteAlertNotificationCommand
- type DeleteApiKeyCommand
- type DeleteDashboardCommand
- type DeleteDashboardSnapshotCommand
- type DeleteDataSourceByIdCommand
- type DeleteDataSourceByNameCommand
- type DeleteExpiredSnapshotsCommand
- type DeleteOrgCommand
- type DeletePlaylistCommand
- type DeleteUserCommand
- type DsAccess
- type ExecutionErrorOption
- type GetAdminStatsQuery
- type GetAlertByIdQuery
- type GetAlertNotificationsQuery
- type GetAlertNotificationsToSendQuery
- type GetAlertStatesForDashboardQuery
- type GetAlertsQuery
- type GetAllAlertNotificationsQuery
- type GetAllAlertsQuery
- type GetApiKeyByIdQuery
- type GetApiKeyByNameQuery
- type GetApiKeysQuery
- type GetDBHealthQuery
- type GetDashboardQuery
- type GetDashboardSlugByIdQuery
- type GetDashboardSnapshotQuery
- type GetDashboardSnapshotsQuery
- type GetDashboardTagsQuery
- type GetDashboardVersionQuery
- type GetDashboardVersionsQuery
- type GetDashboardsByPluginIdQuery
- type GetDashboardsQuery
- type GetDataSourceByIdQuery
- type GetDataSourceByNameQuery
- type GetDataSourceStatsQuery
- type GetDataSourcesQuery
- type GetGlobalQuotaByTargetQuery
- type GetOrgByIdQuery
- type GetOrgByNameQuery
- type GetOrgQuotaByTargetQuery
- type GetOrgQuotasQuery
- type GetOrgUsersQuery
- type GetPlaylistByIdQuery
- type GetPlaylistItemsByIdQuery
- type GetPlaylistsQuery
- type GetPluginSettingByIdQuery
- type GetPluginSettingsQuery
- type GetPreferencesQuery
- type GetPreferencesWithDefaultsQuery
- type GetSignedInUserQuery
- type GetSystemStatsQuery
- type GetTempUserByCodeQuery
- type GetTempUsersQuery
- type GetUserByEmailQuery
- type GetUserByIdQuery
- type GetUserByLoginQuery
- type GetUserOrgListQuery
- type GetUserProfileQuery
- type GetUserQuotaByTargetQuery
- type GetUserQuotasQuery
- type GetUserStarsQuery
- type GlobalQuotaDTO
- type GrafanaServer
- type HeartBeat
- type HeartBeatCommand
- type HelpFlags1
- type HomeDashboard
- type InsertSqlTestDataCommand
- type IsStarredByUserQuery
- type NoDataOption
- type OAuthType
- type Org
- type OrgDTO
- type OrgDetailsDTO
- type OrgQuotaDTO
- type OrgUser
- type OrgUserDTO
- type Password
- type PauseAlertCommand
- type PauseAllAlertCommand
- type Playlist
- type PlaylistDTO
- type PlaylistDashboard
- type PlaylistDashboards
- type PlaylistItem
- type PlaylistItemDTO
- type Playlists
- type PluginSetting
- type PluginSettingInfoDTO
- type PluginStateChangedEvent
- type Preferences
- type Quota
- type QuotaScope
- type RemoveOrgUserCommand
- type RoleType
- type SaveAlertsCommand
- type SaveDashboardCommand
- type SavePreferencesCommand
- type SearchHit
- type SearchOrgsQuery
- type SearchUserQueryResult
- type SearchUsersQuery
- type SendEmailCommand
- type SendEmailCommandSync
- type SendResetPasswordEmailCommand
- type SendWebhookSync
- type SetAlertStateCommand
- type SetUserHelpFlagCommand
- type SetUsingOrgCommand
- type SignedInUser
- type SqlTestData
- type Star
- type StarDashboardCommand
- type StreamInfo
- type StreamList
- type StreamManager
- type StreamPacket
- type StreamSeries
- type SystemStats
- type Tag
- type TempUser
- type TempUserDTO
- type TempUserStatus
- type TimePoint
- type TimeSeriesPoints
- type UnstarDashboardCommand
- type UpdateAlertNotificationCommand
- type UpdateApiKeyCommand
- type UpdateDataSourceCommand
- type UpdateOrgAddressCommand
- type UpdateOrgCommand
- type UpdateOrgQuotaCmd
- type UpdateOrgUserCommand
- type UpdatePlaylistCommand
- type UpdatePluginDashboardError
- type UpdatePluginSettingCmd
- type UpdatePluginSettingVersionCmd
- type UpdateTempUserStatusCommand
- type UpdateTempUserWithEmailSentCommand
- type UpdateUserCommand
- type UpdateUserLastSeenAtCommand
- type UpdateUserPermissionsCommand
- type UpdateUserQuotaCmd
- type User
- type UserIdDTO
- type UserOrgDTO
- type UserProfileDTO
- type UserQuotaDTO
- type UserSearchHitDTO
- type ValidateResetPasswordCodeQuery
Constants ¶
const ( DS_GRAPHITE = "graphite" DS_INFLUXDB = "influxdb" DS_INFLUXDB_08 = "influxdb_08" DS_ES = "elasticsearch" DS_OPENTSDB = "opentsdb" DS_CLOUDWATCH = "cloudwatch" DS_KAIROSDB = "kairosdb" DS_PROMETHEUS = "prometheus" DS_POSTGRES = "postgres" DS_MYSQL = "mysql" DS_ACCESS_DIRECT = "direct" DS_ACCESS_PROXY = "proxy" )
Variables ¶
var ( ErrCannotChangeStateOnPausedAlert error = fmt.Errorf("Cannot change state on pause alert") ErrRequiresNewState error = fmt.Errorf("update alert state requires a new state.") )
var ( ErrDashboardVersionNotFound = errors.New("Dashboard version not found") ErrNoVersionsForDashboardId = errors.New("No dashboard versions found for the given DashboardId") )
var ( ErrDashboardNotFound = errors.New("Dashboard not found") ErrDashboardSnapshotNotFound = errors.New("Dashboard snapshot not found") ErrDashboardWithSameNameExists = errors.New("A dashboard with the same name already exists") ErrDashboardVersionMismatch = errors.New("The dashboard has been changed by someone else") ErrDashboardTitleEmpty = errors.New("Dashboard title cannot be empty") )
Typed errors
var ( DashTypeJson = "file" DashTypeDB = "db" DashTypeScript = "script" DashTypeSnapshot = "snapshot" )
var ( ErrDataSourceNotFound = errors.New("Data source not found") ErrDataSourceNameExists = errors.New("Data source with same name already exists") )
Typed errors
var ( ErrOrgNotFound = errors.New("Organization not found") ErrOrgNameTaken = errors.New("Organization name is taken") )
Typed errors
var ( ErrInvalidRoleType = errors.New("Invalid role type") ErrLastOrgAdmin = errors.New("Cannot remove last organization admin") ErrOrgUserNotFound = errors.New("Cannot find the organization user") ErrOrgUserAlreadyAdded = errors.New("User is already added to organization") )
Typed errors
var ( ErrPlaylistNotFound = errors.New("Playlist not found") ErrPlaylistWithSameNameExists = errors.New("A playlist with the same name already exists") )
Typed errors
var ErrCommandValidationFailed = errors.New("Command missing required fields")
var ErrInvalidApiKey = errors.New("Invalid API Key")
var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
var ErrInvalidQuotaTarget = errors.New("Invalid quota target")
var (
ErrPluginSettingNotFound = errors.New("Plugin setting not found")
)
var (
ErrPreferencesNotFound = errors.New("Preferences not found")
)
Typed errors
var ErrSmtpNotEnabled = errors.New("SMTP not configured, check your grafana.ini config file's [smtp] section.")
var (
ErrTempUserNotFound = errors.New("User not found")
)
Typed errors
var (
ErrUserNotFound = errors.New("User not found")
)
Typed errors
Functions ¶
func ContainsTag ¶
func IsKnownDataSourcePlugin ¶
func JoinTagPairs ¶
Types ¶
type AddApiKeyCommand ¶
type AddApiKeyCommand struct { Name string `json:"name" binding:"Required"` Role RoleType `json:"role" binding:"Required"` OrgId int64 `json:"-"` Key string `json:"-"` Result *ApiKey `json:"-"` }
--------------------- COMMANDS
type AddDataSourceCommand ¶
type AddDataSourceCommand struct { Name string `json:"name" binding:"Required"` Type string `json:"type" binding:"Required"` Access DsAccess `json:"access" binding:"Required"` Url string `json:"url"` Password string `json:"password"` Database string `json:"database"` User string `json:"user"` BasicAuth bool `json:"basicAuth"` BasicAuthUser string `json:"basicAuthUser"` BasicAuthPassword string `json:"basicAuthPassword"` WithCredentials bool `json:"withCredentials"` IsDefault bool `json:"isDefault"` JsonData *simplejson.Json `json:"jsonData"` SecureJsonData map[string]string `json:"secureJsonData"` OrgId int64 `json:"-"` Result *DataSource }
Also acts as api DTO
type AddOrgUserCommand ¶
type AdminStats ¶
type AdminStats struct { Users int `json:"users"` Orgs int `json:"orgs"` Dashboards int `json:"dashboards"` Snapshots int `json:"snapshots"` Tags int `json:"tags"` Datasources int `json:"datasources"` Playlists int `json:"playlists"` Stars int `json:"stars"` Alerts int `json:"alerts"` ActiveUsers int `json:"activeUsers"` }
type Alert ¶
type Alert struct { Id int64 Version int64 OrgId int64 DashboardId int64 PanelId int64 Name string Message string Severity string State AlertStateType Handler int64 Silenced bool ExecutionError string Frequency int64 EvalData *simplejson.Json NewStateDate time.Time StateChanges int Created time.Time Updated time.Time Settings *simplejson.Json }
func (*Alert) ContainsUpdates ¶
func (*Alert) ShouldUpdateState ¶
func (alert *Alert) ShouldUpdateState(newState AlertStateType) bool
func (*Alert) ValidToSave ¶
type AlertNotification ¶
type AlertSeverityType ¶
type AlertSeverityType string
type AlertStateInfoDTO ¶
type AlertStateType ¶
type AlertStateType string
const ( AlertStateNoData AlertStateType = "no_data" AlertStatePaused AlertStateType = "paused" AlertStateAlerting AlertStateType = "alerting" AlertStateOK AlertStateType = "ok" AlertStatePending AlertStateType = "pending" )
func (AlertStateType) IsValid ¶
func (s AlertStateType) IsValid() bool
type AlertingClusterInfo ¶
type CreateAlertNotificationCommand ¶
type CreateAlertNotificationCommand struct { Name string `json:"name" binding:"Required"` Type string `json:"type" binding:"Required"` IsDefault bool `json:"isDefault"` Settings *simplejson.Json `json:"settings"` OrgId int64 `json:"-"` Result *AlertNotification }
type CreateDashboardSnapshotCommand ¶
type CreateDashboardSnapshotCommand struct { Dashboard *simplejson.Json `json:"dashboard" binding:"Required"` Name string `json:"name"` Expires int64 `json:"expires"` // these are passed when storing an external snapshot ref External bool `json:"external"` Key string `json:"key"` DeleteKey string `json:"deleteKey"` OrgId int64 `json:"-"` UserId int64 `json:"-"` Result *DashboardSnapshot }
type CreateOrgCommand ¶
type CreatePlaylistCommand ¶
type CreatePlaylistCommand struct { Name string `json:"name" binding:"Required"` Interval string `json:"interval"` Items []PlaylistItemDTO `json:"items"` OrgId int64 `json:"-"` Result *Playlist }
type CreateTempUserCommand ¶
type CreateUserCommand ¶
type Dashboard ¶
type Dashboard struct { Id int64 Slug string OrgId int64 GnetId int64 Version int PluginId string Created time.Time Updated time.Time UpdatedBy int64 CreatedBy int64 Title string Data *simplejson.Json }
Dashboard model
func NewDashboardFromJson ¶
func NewDashboardFromJson(data *simplejson.Json) *Dashboard
type DashboardSnapshot ¶
type DashboardSnapshot struct { Id int64 Name string Key string DeleteKey string OrgId int64 UserId int64 External bool ExternalUrl string Expires time.Time Created time.Time Updated time.Time Dashboard *simplejson.Json }
DashboardSnapshot model
type DashboardSnapshotDTO ¶
type DashboardSnapshotDTO struct { Id int64 `json:"id"` Name string `json:"name"` Key string `json:"key"` DeleteKey string `json:"deleteKey"` OrgId int64 `json:"orgId"` UserId int64 `json:"userId"` External bool `json:"external"` ExternalUrl string `json:"externalUrl"` Expires time.Time `json:"expires"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
DashboardSnapshotDTO without dashboard map
type DashboardSnapshots ¶
type DashboardSnapshots []*DashboardSnapshot
type DashboardSnapshotsList ¶
type DashboardSnapshotsList []*DashboardSnapshotDTO
type DashboardTagCloudItem ¶
type DashboardVersion ¶
type DashboardVersion struct { Id int64 `json:"id"` DashboardId int64 `json:"dashboardId"` ParentVersion int `json:"parentVersion"` RestoredFrom int `json:"restoredFrom"` Version int `json:"version"` Created time.Time `json:"created"` CreatedBy int64 `json:"createdBy"` Message string `json:"message"` Data *simplejson.Json `json:"data"` }
A DashboardVersion represents the comparable data in a dashboard, allowing diffs of the dashboard to be performed.
type DashboardVersionDTO ¶
type DashboardVersionDTO struct { Id int64 `json:"id"` DashboardId int64 `json:"dashboardId"` ParentVersion int `json:"parentVersion"` RestoredFrom int `json:"restoredFrom"` Version int `json:"version"` Created time.Time `json:"created"` CreatedBy string `json:"createdBy"` Message string `json:"message"` }
DashboardVersionDTO represents a dashboard version, without the dashboard map.
type DashboardVersionMeta ¶
type DashboardVersionMeta struct { DashboardVersion CreatedBy string `json:"createdBy"` }
DashboardVersionMeta extends the dashboard version model with the names associated with the UserIds, overriding the field with the same name from the DashboardVersion model.
type DataSource ¶
type DataSource struct { Id int64 OrgId int64 Version int Name string Type string Access DsAccess Url string Password string User string Database string BasicAuth bool BasicAuthUser string BasicAuthPassword string WithCredentials bool IsDefault bool JsonData *simplejson.Json SecureJsonData securejsondata.SecureJsonData Created time.Time Updated time.Time }
func (*DataSource) GetHttpClient ¶
func (ds *DataSource) GetHttpClient() (*http.Client, error)
func (*DataSource) GetHttpTransport ¶
func (ds *DataSource) GetHttpTransport() (*http.Transport, error)
type DataSourceStats ¶
type DeleteAlertCommand ¶
type DeleteAlertCommand struct {
AlertId int64
}
type DeleteApiKeyCommand ¶
type DeleteDashboardCommand ¶
type DeleteDashboardSnapshotCommand ¶
type DeleteDashboardSnapshotCommand struct {
DeleteKey string `json:"-"`
}
type DeleteExpiredSnapshotsCommand ¶
type DeleteExpiredSnapshotsCommand struct { }
type DeleteOrgCommand ¶
type DeleteOrgCommand struct {
Id int64
}
type DeletePlaylistCommand ¶
type DeleteUserCommand ¶
type DeleteUserCommand struct {
UserId int64
}
type ExecutionErrorOption ¶
type ExecutionErrorOption string
const ( ExecutionErrorSetAlerting ExecutionErrorOption = "alerting" ExecutionErrorKeepState ExecutionErrorOption = "keep_state" )
func (ExecutionErrorOption) IsValid ¶
func (s ExecutionErrorOption) IsValid() bool
func (ExecutionErrorOption) ToAlertState ¶
func (s ExecutionErrorOption) ToAlertState() AlertStateType
type GetAdminStatsQuery ¶
type GetAdminStatsQuery struct {
Result *AdminStats
}
type GetAlertByIdQuery ¶
type GetAlertNotificationsQuery ¶
type GetAlertNotificationsQuery struct { Name string Id int64 OrgId int64 Result *AlertNotification }
type GetAlertNotificationsToSendQuery ¶
type GetAlertNotificationsToSendQuery struct { Ids []int64 OrgId int64 Result []*AlertNotification }
type GetAlertStatesForDashboardQuery ¶
type GetAlertStatesForDashboardQuery struct { OrgId int64 DashboardId int64 Result []*AlertStateInfoDTO }
type GetAlertsQuery ¶
type GetAlertsQuery struct { OrgId int64 State []string DashboardId int64 PanelId int64 Limit int64 Result []*Alert }
Queries
type GetAllAlertNotificationsQuery ¶
type GetAllAlertNotificationsQuery struct { OrgId int64 Result []*AlertNotification }
type GetAllAlertsQuery ¶
type GetAllAlertsQuery struct {
Result []*Alert
}
type GetApiKeyByIdQuery ¶
type GetApiKeyByNameQuery ¶
type GetApiKeysQuery ¶
type GetDBHealthQuery ¶
type GetDBHealthQuery struct{}
type GetDashboardQuery ¶
type GetDashboardSnapshotQuery ¶
type GetDashboardSnapshotQuery struct { Key string Result *DashboardSnapshot }
type GetDashboardSnapshotsQuery ¶
type GetDashboardSnapshotsQuery struct { Name string Limit int OrgId int64 Result DashboardSnapshotsList }
type GetDashboardTagsQuery ¶
type GetDashboardTagsQuery struct { OrgId int64 Result []*DashboardTagCloudItem }
type GetDashboardVersionQuery ¶
type GetDashboardVersionQuery struct { DashboardId int64 OrgId int64 Version int Result *DashboardVersion }
type GetDashboardVersionsQuery ¶
type GetDashboardVersionsQuery struct { DashboardId int64 OrgId int64 Limit int Start int Result []*DashboardVersionDTO }
type GetDashboardsQuery ¶
type GetDataSourceByIdQuery ¶
type GetDataSourceByIdQuery struct { Id int64 OrgId int64 Result *DataSource }
type GetDataSourceByNameQuery ¶
type GetDataSourceByNameQuery struct { Name string OrgId int64 Result *DataSource }
type GetDataSourceStatsQuery ¶
type GetDataSourceStatsQuery struct {
Result []*DataSourceStats
}
type GetDataSourcesQuery ¶
type GetDataSourcesQuery struct { OrgId int64 Result []*DataSource }
type GetGlobalQuotaByTargetQuery ¶
type GetGlobalQuotaByTargetQuery struct { Target string Default int64 Result *GlobalQuotaDTO }
type GetOrgByIdQuery ¶
type GetOrgByNameQuery ¶
type GetOrgQuotaByTargetQuery ¶
type GetOrgQuotaByTargetQuery struct { Target string OrgId int64 Default int64 Result *OrgQuotaDTO }
type GetOrgQuotasQuery ¶
type GetOrgQuotasQuery struct { OrgId int64 Result []*OrgQuotaDTO }
type GetOrgUsersQuery ¶
type GetOrgUsersQuery struct { OrgId int64 Result []*OrgUserDTO }
type GetPlaylistByIdQuery ¶
type GetPlaylistItemsByIdQuery ¶
type GetPlaylistItemsByIdQuery struct { PlaylistId int64 Result *[]PlaylistItem }
type GetPlaylistsQuery ¶
type GetPluginSettingByIdQuery ¶
type GetPluginSettingByIdQuery struct { PluginId string OrgId int64 Result *PluginSetting }
type GetPluginSettingsQuery ¶
type GetPluginSettingsQuery struct { OrgId int64 Result []*PluginSettingInfoDTO }
--------------------- QUERIES
type GetPreferencesQuery ¶
type GetPreferencesQuery struct { Id int64 OrgId int64 UserId int64 Result *Preferences }
type GetPreferencesWithDefaultsQuery ¶
type GetPreferencesWithDefaultsQuery struct { Id int64 OrgId int64 UserId int64 Result *Preferences }
type GetSignedInUserQuery ¶
type GetSignedInUserQuery struct { UserId int64 Login string Email string OrgId int64 Result *SignedInUser }
type GetSystemStatsQuery ¶
type GetSystemStatsQuery struct {
Result *SystemStats
}
type GetTempUserByCodeQuery ¶
type GetTempUserByCodeQuery struct { Code string Result *TempUserDTO }
type GetTempUsersQuery ¶
type GetTempUsersQuery struct { OrgId int64 Email string Status TempUserStatus Result []*TempUserDTO }
type GetUserByEmailQuery ¶
type GetUserByIdQuery ¶
type GetUserByLoginQuery ¶
type GetUserOrgListQuery ¶
type GetUserOrgListQuery struct { UserId int64 Result []*UserOrgDTO }
type GetUserProfileQuery ¶
type GetUserProfileQuery struct { UserId int64 Result UserProfileDTO }
type GetUserQuotaByTargetQuery ¶
type GetUserQuotaByTargetQuery struct { Target string UserId int64 Default int64 Result *UserQuotaDTO }
type GetUserQuotasQuery ¶
type GetUserQuotasQuery struct { UserId int64 Result []*UserQuotaDTO }
type GetUserStarsQuery ¶
type GlobalQuotaDTO ¶
type GrafanaServer ¶
type HeartBeatCommand ¶
type HeartBeatCommand struct { ServerId string Result AlertingClusterInfo }
type HelpFlags1 ¶
type HelpFlags1 uint64
const ( HelpFlagGettingStartedPanelDismissed HelpFlags1 = 1 << iota HelpFlagDashboardHelp1 )
func (*HelpFlags1) AddFlag ¶
func (f *HelpFlags1) AddFlag(flag HelpFlags1)
func (*HelpFlags1) ClearFlag ¶
func (f *HelpFlags1) ClearFlag(flag HelpFlags1)
func (HelpFlags1) HasFlag ¶
func (f HelpFlags1) HasFlag(flag HelpFlags1) bool
func (*HelpFlags1) ToggleFlag ¶
func (f *HelpFlags1) ToggleFlag(flag HelpFlags1)
type HomeDashboard ¶
type InsertSqlTestDataCommand ¶
type InsertSqlTestDataCommand struct { }
type IsStarredByUserQuery ¶
type NoDataOption ¶
type NoDataOption string
const ( NoDataSetOK NoDataOption = "ok" NoDataSetNoData NoDataOption = "no_data" NoDataKeepState NoDataOption = "keep_state" NoDataSetAlerting NoDataOption = "alerting" )
func (NoDataOption) IsValid ¶
func (s NoDataOption) IsValid() bool
func (NoDataOption) ToAlertState ¶
func (s NoDataOption) ToAlertState() AlertStateType
type OrgDetailsDTO ¶
type OrgQuotaDTO ¶
type OrgUserDTO ¶
type PauseAlertCommand ¶
type PauseAllAlertCommand ¶
type Playlist ¶
type Playlist struct { Id int64 `json:"id"` Name string `json:"name"` Interval string `json:"interval"` OrgId int64 `json:"-"` }
Playlist model
type PlaylistDTO ¶
type PlaylistDTO struct { Id int64 `json:"id"` Name string `json:"name"` Interval string `json:"interval"` OrgId int64 `json:"-"` Items []PlaylistItemDTO `json:"items"` }
type PlaylistDashboard ¶
type PlaylistDashboard struct { Id int64 `json:"id"` Slug string `json:"slug"` Title string `json:"title"` }
func (PlaylistDashboard) TableName ¶
func (this PlaylistDashboard) TableName() string
type PlaylistDashboards ¶
type PlaylistDashboards []*PlaylistDashboard
type PlaylistItem ¶
type PlaylistItemDTO ¶
type PluginSetting ¶
type PluginSettingInfoDTO ¶
type PluginStateChangedEvent ¶
type Preferences ¶
type QuotaScope ¶
func GetQuotaScopes ¶
func GetQuotaScopes(target string) ([]QuotaScope, error)
type RemoveOrgUserCommand ¶
type SaveAlertsCommand ¶
type SaveDashboardCommand ¶
type SaveDashboardCommand struct { Dashboard *simplejson.Json `json:"dashboard" binding:"Required"` UserId int64 `json:"userId"` Overwrite bool `json:"overwrite"` Message string `json:"message"` OrgId int64 `json:"-"` RestoredFrom int `json:"-"` PluginId string `json:"-"` Result *Dashboard }
func (*SaveDashboardCommand) GetDashboardModel ¶
func (cmd *SaveDashboardCommand) GetDashboardModel() *Dashboard
GetDashboardModel turns the command into the savable model
type SavePreferencesCommand ¶
type SavePreferencesCommand struct { UserId int64 OrgId int64 HomeDashboardId int64 `json:"homeDashboardId"` Timezone string `json:"timezone"` Theme string `json:"theme"` }
--------------------- COMMANDS
type SearchOrgsQuery ¶
type SearchUserQueryResult ¶
type SearchUserQueryResult struct { TotalCount int64 `json:"totalCount"` Users []*UserSearchHitDTO `json:"users"` Page int `json:"page"` PerPage int `json:"perPage"` }
type SearchUsersQuery ¶
type SearchUsersQuery struct { OrgId int64 Query string Page int Limit int Result SearchUserQueryResult }
type SendEmailCommand ¶
type SendEmailCommandSync ¶
type SendEmailCommandSync struct {
SendEmailCommand
}
type SendResetPasswordEmailCommand ¶
type SendResetPasswordEmailCommand struct {
User *User
}
type SendWebhookSync ¶
type SetAlertStateCommand ¶
type SetAlertStateCommand struct { AlertId int64 OrgId int64 State AlertStateType Error string EvalData *simplejson.Json Timestamp time.Time }
type SetUserHelpFlagCommand ¶
type SetUserHelpFlagCommand struct { HelpFlags1 HelpFlags1 UserId int64 }
type SetUsingOrgCommand ¶
type SignedInUser ¶
type SignedInUser struct { UserId int64 OrgId int64 OrgName string OrgRole RoleType Login string Name string Email string ApiKeyId int64 IsGrafanaAdmin bool HelpFlags1 HelpFlags1 LastSeenAt time.Time }
func (*SignedInUser) ShouldUpdateLastSeenAt ¶
func (u *SignedInUser) ShouldUpdateLastSeenAt() bool
type SqlTestData ¶
type StarDashboardCommand ¶
type StreamInfo ¶
type StreamInfo struct {
Name string
}
type StreamList ¶
type StreamList []*StreamInfo
type StreamManager ¶
type StreamManager interface { GetStreamList() StreamList Push(data *StreamPacket) }
type StreamPacket ¶
type StreamPacket struct { Stream string `json:"stream"` Series []StreamSeries `json:"series"` }
type StreamSeries ¶
type StreamSeries struct { Name string `json:"name"` Points TimeSeriesPoints `json:"points"` }
type SystemStats ¶
type Tag ¶
func ParseTagPairs ¶
type TempUser ¶
type TempUser struct { Id int64 OrgId int64 Version int Email string Name string Role RoleType InvitedByUserId int64 Status TempUserStatus EmailSent bool EmailSentOn time.Time Code string RemoteAddr string Created time.Time Updated time.Time }
TempUser holds data for org invites and unconfirmed sign ups
type TempUserDTO ¶
type TempUserDTO struct { Id int64 `json:"id"` OrgId int64 `json:"orgId"` Name string `json:"name"` Email string `json:"email"` Role RoleType `json:"role"` InvitedByLogin string `json:"invitedByLogin"` InvitedByEmail string `json:"invitedByEmail"` InvitedByName string `json:"invitedByName"` Code string `json:"code"` Status TempUserStatus `json:"status"` Url string `json:"url"` EmailSent bool `json:"emailSent"` EmailSentOn time.Time `json:"emailSentOn"` Created time.Time `json:"createdOn"` }
type TempUserStatus ¶
type TempUserStatus string
const ( TmpUserSignUpStarted TempUserStatus = "SignUpStarted" TmpUserInvitePending TempUserStatus = "InvitePending" TmpUserCompleted TempUserStatus = "Completed" TmpUserRevoked TempUserStatus = "Revoked" )
type TimeSeriesPoints ¶
type TimeSeriesPoints []TimePoint
type UnstarDashboardCommand ¶
type UpdateAlertNotificationCommand ¶
type UpdateAlertNotificationCommand struct { Id int64 `json:"id" binding:"Required"` Name string `json:"name" binding:"Required"` Type string `json:"type" binding:"Required"` IsDefault bool `json:"isDefault"` Settings *simplejson.Json `json:"settings" binding:"Required"` OrgId int64 `json:"-"` Result *AlertNotification }
type UpdateApiKeyCommand ¶
type UpdateDataSourceCommand ¶
type UpdateDataSourceCommand struct { Name string `json:"name" binding:"Required"` Type string `json:"type" binding:"Required"` Access DsAccess `json:"access" binding:"Required"` Url string `json:"url"` Password string `json:"password"` User string `json:"user"` Database string `json:"database"` BasicAuth bool `json:"basicAuth"` BasicAuthUser string `json:"basicAuthUser"` BasicAuthPassword string `json:"basicAuthPassword"` WithCredentials bool `json:"withCredentials"` IsDefault bool `json:"isDefault"` JsonData *simplejson.Json `json:"jsonData"` SecureJsonData map[string]string `json:"secureJsonData"` OrgId int64 `json:"-"` Id int64 `json:"-"` Version int `json:"-"` }
Also acts as api DTO
type UpdateOrgAddressCommand ¶
type UpdateOrgCommand ¶
type UpdateOrgQuotaCmd ¶
type UpdateOrgUserCommand ¶
type UpdatePlaylistCommand ¶
type UpdatePlaylistCommand struct { OrgId int64 `json:"-"` Id int64 `json:"id" binding:"Required"` Name string `json:"name" binding:"Required"` Interval string `json:"interval"` Items []PlaylistItemDTO `json:"items"` Result *PlaylistDTO }
type UpdatePluginDashboardError ¶
type UpdatePluginDashboardError struct {
PluginId string
}
func (UpdatePluginDashboardError) Error ¶
func (d UpdatePluginDashboardError) Error() string
type UpdatePluginSettingCmd ¶
type UpdatePluginSettingCmd struct { Enabled bool `json:"enabled"` Pinned bool `json:"pinned"` JsonData map[string]interface{} `json:"jsonData"` SecureJsonData map[string]string `json:"secureJsonData"` PluginVersion string `json:"version"` PluginId string `json:"-"` OrgId int64 `json:"-"` }
Also acts as api DTO
func (*UpdatePluginSettingCmd) GetEncryptedJsonData ¶
func (cmd *UpdatePluginSettingCmd) GetEncryptedJsonData() securejsondata.SecureJsonData
type UpdatePluginSettingVersionCmd ¶
type UpdatePluginSettingVersionCmd struct { PluginVersion string PluginId string `json:"-"` OrgId int64 `json:"-"` }
specific command, will only update version
type UpdateTempUserStatusCommand ¶
type UpdateTempUserStatusCommand struct { Code string Status TempUserStatus }
type UpdateTempUserWithEmailSentCommand ¶
type UpdateTempUserWithEmailSentCommand struct {
Code string
}
type UpdateUserCommand ¶
type UpdateUserLastSeenAtCommand ¶
type UpdateUserLastSeenAtCommand struct {
UserId int64
}
type UpdateUserQuotaCmd ¶
type User ¶
type User struct { Id int64 Version int Email string Name string Login string Password string Salt string Rands string Company string EmailVerified bool Theme string HelpFlags1 HelpFlags1 IsAdmin bool OrgId int64 Created time.Time Updated time.Time LastSeenAt time.Time }
func (*User) NameOrFallback ¶
type UserOrgDTO ¶
type UserProfileDTO ¶
type UserQuotaDTO ¶
type UserSearchHitDTO ¶
Source Files ¶
- address.go
- alert.go
- alert_notifications.go
- apikey.go
- dashboard_snapshot.go
- dashboard_version.go
- dashboards.go
- datasource.go
- datasource_cache.go
- health.go
- helpflags.go
- home_dashboard.go
- models.go
- notifications.go
- org.go
- org_user.go
- playlist.go
- plugin_settings.go
- preferences.go
- quotas.go
- search.go
- server.go
- star.go
- stats.go
- streams.go
- tags.go
- temp_user.go
- test_data.go
- user.go