Documentation ¶
Index ¶
- Constants
- Variables
- func IsKnownDataSourcePlugin(dsType string) bool
- type AddApiKeyCommand
- type AddDataSourceCommand
- type AddOrgUserCommand
- type Address
- type AdminStats
- type ApiKey
- type ApiKeyDTO
- type ChangeUserPasswordCommand
- type CreateDashboardSnapshotCommand
- type CreateOrgCommand
- type CreatePlaylistCommand
- type CreateTempUserCommand
- type CreateUserCommand
- type Dashboard
- type DashboardSnapshot
- type DashboardSnapshotDTO
- type DashboardSnapshots
- type DashboardTagCloudItem
- type DataSource
- type DataSourceCreatedEvent
- type DataSourceStats
- type DeleteApiKeyCommand
- type DeleteDashboardCommand
- type DeleteDashboardSnapshotCommand
- type DeleteDataSourceCommand
- type DeleteOrgCommand
- type DeletePlaylistCommand
- type DeleteUserCommand
- type DsAccess
- type GetAdminStatsQuery
- type GetApiKeyByIdQuery
- type GetApiKeyByNameQuery
- type GetApiKeysQuery
- type GetDashboardQuery
- type GetDashboardSlugByIdQuery
- type GetDashboardSnapshotQuery
- type GetDashboardSnapshotsQuery
- type GetDashboardTagsQuery
- 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 GetUserByIdQuery
- type GetUserByLoginQuery
- type GetUserOrgListQuery
- type GetUserProfileQuery
- type GetUserQuotaByTargetQuery
- type GetUserQuotasQuery
- type GetUserStarsQuery
- type GlobalQuotaDTO
- type HomeDashboard
- type IsStarredByUserQuery
- type OAuthType
- type Org
- type OrgDTO
- type OrgDetailsDTO
- type OrgQuotaDTO
- type OrgUser
- type OrgUserDTO
- type Playlist
- type PlaylistDTO
- type PlaylistDashboard
- type PlaylistDashboardDto
- type PlaylistDashboards
- type PlaylistItem
- type PlaylistItemDTO
- type Playlists
- type PluginSetting
- type PluginSettingInfoDTO
- type Preferences
- type Quota
- type QuotaScope
- type RemoveOrgUserCommand
- type RoleType
- type SaveDashboardCommand
- type SavePreferencesCommand
- type SearchHit
- type SearchOrgsQuery
- type SearchUsersQuery
- type SecureJsonData
- type SendEmailCommand
- type SendResetPasswordEmailCommand
- type SetUsingOrgCommand
- type SignedInUser
- type Star
- type StarDashboardCommand
- type SystemStats
- type TempUser
- type TempUserDTO
- type TempUserStatus
- type UnstarDashboardCommand
- type UpdateApiKeyCommand
- type UpdateDataSourceCommand
- type UpdateOrgAddressCommand
- type UpdateOrgCommand
- type UpdateOrgQuotaCmd
- type UpdateOrgUserCommand
- type UpdatePlaylistCommand
- type UpdatePluginSettingCmd
- type UpdateTempUserStatusCommand
- type UpdateUserCommand
- type UpdateUserPermissionsCommand
- type UpdateUserQuotaCmd
- type User
- type UserIdDTO
- type UserOrgDTO
- type UserProfileDTO
- type UserQuotaDTO
- type UserSearchHitDTO
- type ValidateResetPasswordCodeQuery
Constants ¶
View Source
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_ACCESS_DIRECT = "direct" DS_ACCESS_PROXY = "proxy" )
Variables ¶
View Source
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") )
Typed errors
View Source
var ( DashTypeJson = "file" DashTypeDB = "db" DashTypeScript = "script" DashTypeSnapshot = "snapshot" )
View Source
var ( ErrOrgNotFound = errors.New("Organization not found") ErrOrgNameTaken = errors.New("Organization name is taken") )
Typed errors
View Source
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
View Source
var ( ErrPlaylistNotFound = errors.New("Playlist not found") ErrPlaylistWithSameNameExists = errors.New("A playlist with the same name already exists") )
Typed errors
View Source
var ErrCommandValidationFailed = errors.New("Command missing required fields")
View Source
var (
ErrDataSourceNotFound = errors.New("Data source not found")
)
Typed errors
View Source
var ErrInvalidApiKey = errors.New("Invalid API Key")
View Source
var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
View Source
var ErrInvalidQuotaTarget = errors.New("Invalid quota target")
View Source
var (
ErrPluginSettingNotFound = errors.New("Plugin setting not found")
)
View Source
var (
ErrPreferencesNotFound = errors.New("Preferences not found")
)
Typed errors
View Source
var (
ErrTempUserNotFound = errors.New("User not found")
)
Typed errors
View Source
var (
ErrUserNotFound = errors.New("User not found")
)
Typed errors
Functions ¶
func IsKnownDataSourcePlugin ¶
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"` OrgId int64 `json:"-"` Result *DataSource }
Also acts as api DTO
type AddOrgUserCommand ¶
type AdminStats ¶
type AdminStats struct { UserCount int `json:"user_count"` OrgCount int `json:"org_count"` DashboardCount int `json:"dashboard_count"` DbSnapshotCount int `json:"db_snapshot_count"` DbTagCount int `json:"db_tag_count"` DataSourceCount int `json:"data_source_count"` PlaylistCount int `json:"playlist_count"` StarredDbCount int `json:"starred_db_count"` }
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 Version int 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 DashboardTagCloudItem ¶
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 Created time.Time Updated time.Time }
type DataSourceStats ¶
type DeleteApiKeyCommand ¶
type DeleteDashboardCommand ¶
type DeleteDashboardSnapshotCommand ¶
type DeleteDashboardSnapshotCommand struct {
DeleteKey string `json:"-"`
}
type DeleteDataSourceCommand ¶
type DeleteOrgCommand ¶
type DeleteOrgCommand struct {
Id int64
}
type DeletePlaylistCommand ¶
type DeleteUserCommand ¶
type DeleteUserCommand struct {
UserId int64
}
type GetAdminStatsQuery ¶
type GetAdminStatsQuery struct {
Result *AdminStats
}
type GetApiKeyByIdQuery ¶
type GetApiKeyByNameQuery ¶
type GetApiKeysQuery ¶
type GetDashboardQuery ¶
type GetDashboardSnapshotQuery ¶
type GetDashboardSnapshotQuery struct { Key string Result *DashboardSnapshot }
type GetDashboardSnapshotsQuery ¶
type GetDashboardSnapshotsQuery struct { Name string Limit int OrgId int64 Result DashboardSnapshots }
type GetDashboardTagsQuery ¶
type GetDashboardTagsQuery struct { OrgId int64 Result []*DashboardTagCloudItem }
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 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 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 HomeDashboard ¶
type IsStarredByUserQuery ¶
type OrgDetailsDTO ¶
type OrgQuotaDTO ¶
type OrgUserDTO ¶
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 PlaylistDashboardDto ¶
type PlaylistDashboards ¶
type PlaylistDashboards []*PlaylistDashboard
type PlaylistItem ¶
type PlaylistItemDTO ¶
type PluginSetting ¶
type PluginSettingInfoDTO ¶
type Preferences ¶
type QuotaScope ¶
func GetQuotaScopes ¶
func GetQuotaScopes(target string) ([]QuotaScope, error)
type RemoveOrgUserCommand ¶
type SaveDashboardCommand ¶
type SaveDashboardCommand struct { Dashboard *simplejson.Json `json:"dashboard" binding:"Required"` UserId int64 `json:"userId"` OrgId int64 `json:"-"` Overwrite bool `json:"overwrite"` 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 SearchUsersQuery ¶
type SearchUsersQuery struct { Query string Page int Limit int Result []*UserSearchHitDTO }
type SecureJsonData ¶
func (SecureJsonData) Decrypt ¶
func (s SecureJsonData) Decrypt() map[string]string
type SendEmailCommand ¶
type SendResetPasswordEmailCommand ¶
type SendResetPasswordEmailCommand struct {
User *User
}
type SetUsingOrgCommand ¶
type SignedInUser ¶
type StarDashboardCommand ¶
type SystemStats ¶
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 UnstarDashboardCommand ¶
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"` OrgId int64 `json:"-"` Id int64 `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 UpdatePluginSettingCmd ¶
type UpdatePluginSettingCmd struct { Enabled bool `json:"enabled"` Pinned bool `json:"pinned"` JsonData map[string]interface{} `json:"jsonData"` SecureJsonData map[string]string `json:"secureJsonData"` PluginId string `json:"-"` OrgId int64 `json:"-"` }
Also acts as api DTO
func (*UpdatePluginSettingCmd) GetEncryptedJsonData ¶
func (cmd *UpdatePluginSettingCmd) GetEncryptedJsonData() SecureJsonData
type UpdateTempUserStatusCommand ¶
type UpdateTempUserStatusCommand struct { Code string Status TempUserStatus }
type UpdateUserCommand ¶
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 IsAdmin bool OrgId int64 Created time.Time Updated time.Time }
func (*User) NameOrFallback ¶
type UserOrgDTO ¶
type UserProfileDTO ¶
type UserQuotaDTO ¶
type UserSearchHitDTO ¶
Click to show internal directories.
Click to hide internal directories.