Documentation ¶
Index ¶
- Constants
- func AddApiKey(cmd *models.AddApiKeyCommand) error
- func AddDataSource(cmd *models.AddDataSourceCommand) error
- func AddOrgUser(cmd *models.AddOrgUserCommand) error
- func AddTeamMember(cmd *models.AddTeamMemberCommand) error
- func BatchDisableUsers(cmd *models.BatchDisableUsersCommand) error
- func ChangeUserPassword(cmd *models.ChangeUserPasswordCommand) error
- func CreateAlertNotificationCommand(cmd *models.CreateAlertNotificationCommand) error
- func CreateDashboardSnapshot(cmd *models.CreateDashboardSnapshotCommand) error
- func CreateLoginAttempt(cmd *models.CreateLoginAttemptCommand) error
- func CreateOrg(cmd *models.CreateOrgCommand) error
- func CreatePlaylist(cmd *models.CreatePlaylistCommand) error
- func CreateTeam(cmd *models.CreateTeamCommand) error
- func CreateTempUser(cmd *models.CreateTempUserCommand) error
- func CreateUser(ctx context.Context, cmd *models.CreateUserCommand) error
- func DeleteAlertNotification(cmd *models.DeleteAlertNotificationCommand) error
- func DeleteAlertNotificationWithUid(cmd *models.DeleteAlertNotificationWithUidCommand) error
- func DeleteApiKeyCtx(ctx context.Context, cmd *models.DeleteApiKeyCommand) error
- func DeleteAuthInfo(cmd *models.DeleteAuthInfoCommand) error
- func DeleteDashboard(cmd *models.DeleteDashboardCommand) error
- func DeleteDashboardSnapshot(cmd *models.DeleteDashboardSnapshotCommand) error
- func DeleteDataSource(cmd *models.DeleteDataSourceCommand) error
- func DeleteExpiredSnapshots(cmd *models.DeleteExpiredSnapshotsCommand) error
- func DeleteExpiredVersions(cmd *models.DeleteExpiredVersionsCommand) error
- func DeleteOldLoginAttempts(cmd *models.DeleteOldLoginAttemptsCommand) error
- func DeleteOrg(cmd *models.DeleteOrgCommand) error
- func DeleteOrphanedProvisionedDashboards(cmd *models.DeleteOrphanedProvisionedDashboardsCommand) error
- func DeletePlaylist(cmd *models.DeletePlaylistCommand) error
- func DeleteTeam(cmd *models.DeleteTeamCommand) error
- func DeleteUser(cmd *models.DeleteUserCommand) error
- func DisableUser(cmd *models.DisableUserCommand) error
- func EnsureTagsExist(sess *DBSession, tags []*models.Tag) ([]*models.Tag, error)
- func ExpireOldUserInvites(cmd *models.ExpireTempUsersCommand) error
- func GetAdminStats(query *models.GetAdminStatsQuery) error
- func GetAlertById(query *models.GetAlertByIdQuery) error
- func GetAlertNotifications(query *models.GetAlertNotificationsQuery) error
- func GetAlertNotificationsWithUid(query *models.GetAlertNotificationsWithUidQuery) error
- func GetAlertNotificationsWithUidToSend(query *models.GetAlertNotificationsWithUidToSendQuery) error
- func GetAlertNotifiersUsageStats(ctx context.Context, query *models.GetAlertNotifierUsageStatsQuery) error
- func GetAlertStatesForDashboard(query *models.GetAlertStatesForDashboardQuery) error
- func GetAlertsByDashboardId2(dashboardId int64, sess *DBSession) ([]*models.Alert, error)
- func GetAllAlertNotifications(query *models.GetAllAlertNotificationsQuery) error
- func GetAllAlertQueryHandler(query *models.GetAllAlertsQuery) error
- func GetApiKeyById(query *models.GetApiKeyByIdQuery) error
- func GetApiKeyByName(query *models.GetApiKeyByNameQuery) error
- func GetApiKeys(query *models.GetApiKeysQuery) error
- func GetAuthInfo(query *models.GetAuthInfoQuery) error
- func GetDBHealthQuery(query *models.GetDBHealthQuery) error
- func GetDashboard(query *models.GetDashboardQuery) error
- func GetDashboardAclInfoList(query *models.GetDashboardAclInfoListQuery) error
- func GetDashboardPermissionsForUser(query *models.GetDashboardPermissionsForUserQuery) error
- func GetDashboardSlugById(query *models.GetDashboardSlugByIdQuery) error
- func GetDashboardSnapshot(query *models.GetDashboardSnapshotQuery) error
- func GetDashboardTags(query *models.GetDashboardTagsQuery) error
- func GetDashboardUIDById(query *models.GetDashboardRefByIdQuery) error
- func GetDashboardVersion(query *models.GetDashboardVersionQuery) error
- func GetDashboardVersions(query *models.GetDashboardVersionsQuery) error
- func GetDashboards(query *models.GetDashboardsQuery) error
- func GetDashboardsByPluginId(query *models.GetDashboardsByPluginIdQuery) error
- func GetDashboardsBySlug(query *models.GetDashboardsBySlugQuery) error
- func GetDataSource(query *models.GetDataSourceQuery) error
- func GetDataSourceAccessStats(query *models.GetDataSourceAccessStatsQuery) error
- func GetDataSourceStats(query *models.GetDataSourceStatsQuery) error
- func GetDataSources(query *models.GetDataSourcesQuery) error
- func GetDataSourcesByType(query *models.GetDataSourcesByTypeQuery) error
- func GetDefaultDataSource(query *models.GetDefaultDataSourceQuery) error
- func GetExternalUserInfoByLogin(query *models.GetExternalUserInfoByLoginQuery) error
- func GetGlobalQuotaByTarget(query *models.GetGlobalQuotaByTargetQuery) error
- func GetOrCreateAlertNotificationState(ctx context.Context, cmd *models.GetOrCreateNotificationStateQuery) error
- func GetOrgById(query *models.GetOrgByIdQuery) error
- func GetOrgByName(query *models.GetOrgByNameQuery) error
- func GetOrgQuotaByTarget(query *models.GetOrgQuotaByTargetQuery) error
- func GetOrgQuotas(query *models.GetOrgQuotasQuery) error
- func GetOrgUsers(query *models.GetOrgUsersQuery) error
- func GetPlaylist(query *models.GetPlaylistByIdQuery) error
- func GetPlaylistItem(query *models.GetPlaylistItemsByIdQuery) error
- func GetPluginSettingById(query *models.GetPluginSettingByIdQuery) error
- func GetPluginSettings(query *models.GetPluginSettingsQuery) error
- func GetPreferences(query *models.GetPreferencesQuery) error
- func GetProvisionedDashboardDataQuery(cmd *models.GetProvisionedDashboardDataQuery) error
- func GetProvisionedDataByDashboardId(cmd *models.GetProvisionedDashboardDataByIdQuery) error
- func GetSignedInUser(query *models.GetSignedInUserQuery) error
- func GetSystemStats(query *models.GetSystemStatsQuery) error
- func GetSystemUserCountStats(ctx context.Context, query *models.GetSystemUserCountStatsQuery) error
- func GetTeamById(query *models.GetTeamByIdQuery) error
- func GetTeamMembers(query *models.GetTeamMembersQuery) error
- func GetTeamsByUser(query *models.GetTeamsByUserQuery) error
- func GetTempUserByCode(query *models.GetTempUserByCodeQuery) error
- func GetTempUsersQuery(query *models.GetTempUsersQuery) error
- func GetUserByAuthInfo(query *models.GetUserByAuthInfoQuery) error
- func GetUserByEmail(query *models.GetUserByEmailQuery) error
- func GetUserById(query *models.GetUserByIdQuery) error
- func GetUserByLogin(query *models.GetUserByLoginQuery) error
- func GetUserLoginAttemptCount(query *models.GetUserLoginAttemptCountQuery) error
- func GetUserOrgList(query *models.GetUserOrgListQuery) error
- func GetUserProfile(query *models.GetUserProfileQuery) error
- func GetUserQuotaByTarget(query *models.GetUserQuotaByTargetQuery) error
- func GetUserQuotas(query *models.GetUserQuotasQuery) error
- func GetUserStars(query *models.GetUserStarsQuery) error
- func HandleAlertsQuery(query *models.GetAlertsQuery) error
- func HasAdminPermissionInFolders(query *models.HasAdminPermissionInFoldersQuery) error
- func HasEditPermissionInFolders(query *models.HasEditPermissionInFoldersQuery) error
- func InsertSQLTestData(cmd *models.InsertSQLTestDataCommand) error
- func IsAdminOfTeams(query *models.IsAdminOfTeamsQuery) error
- func IsStarredByUser(query *models.IsStarredByUserQuery) error
- func IsTestDbMySQL() bool
- func IsTestDbPostgres() bool
- func PauseAlert(cmd *models.PauseAlertCommand) error
- func PauseAllAlerts(cmd *models.PauseAllAlertCommand) error
- func RemoveOrgUser(cmd *models.RemoveOrgUserCommand) error
- func RemoveTeamMember(cmd *models.RemoveTeamMemberCommand) error
- func SaveAlerts(cmd *models.SaveAlertsCommand) error
- func SaveDashboard(cmd *models.SaveDashboardCommand) error
- func SavePreferences(cmd *models.SavePreferencesCommand) error
- func SaveProvisionedDashboard(cmd *models.SaveProvisionedDashboardCommand) error
- func SearchDashboardSnapshots(query *models.GetDashboardSnapshotsQuery) error
- func SearchDashboards(query *search.FindPersistedDashboardsQuery) error
- func SearchOrgs(query *models.SearchOrgsQuery) error
- func SearchPlaylists(query *models.GetPlaylistsQuery) error
- func SearchTeams(query *models.SearchTeamsQuery) error
- func SearchUsers(query *models.SearchUsersQuery) error
- func SetAlertNotificationStateToCompleteCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToCompleteCommand) error
- func SetAlertNotificationStateToPendingCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToPendingCommand) error
- func SetAlertState(cmd *models.SetAlertStateCommand) error
- func SetAuthInfo(cmd *models.SetAuthInfoCommand) error
- func SetUserHelpFlag(cmd *models.SetUserHelpFlagCommand) error
- func SetUsingOrg(cmd *models.SetUsingOrgCommand) error
- func StarDashboard(cmd *models.StarDashboardCommand) error
- func UnprovisionDashboard(cmd *models.UnprovisionDashboardCommand) error
- func UnstarDashboard(cmd *models.UnstarDashboardCommand) error
- func UpdateAlertNotification(cmd *models.UpdateAlertNotificationCommand) error
- func UpdateAlertNotificationWithUid(cmd *models.UpdateAlertNotificationWithUidCommand) error
- func UpdateAuthInfo(cmd *models.UpdateAuthInfoCommand) error
- func UpdateDashboardAcl(cmd *models.UpdateDashboardAclCommand) error
- func UpdateDataSource(cmd *models.UpdateDataSourceCommand) error
- func UpdateOrg(cmd *models.UpdateOrgCommand) error
- func UpdateOrgAddress(cmd *models.UpdateOrgAddressCommand) error
- func UpdateOrgQuota(cmd *models.UpdateOrgQuotaCmd) error
- func UpdateOrgUser(cmd *models.UpdateOrgUserCommand) error
- func UpdatePlaylist(cmd *models.UpdatePlaylistCommand) error
- func UpdatePluginSetting(cmd *models.UpdatePluginSettingCmd) error
- func UpdatePluginSettingVersion(cmd *models.UpdatePluginSettingVersionCmd) error
- func UpdateTeam(cmd *models.UpdateTeamCommand) error
- func UpdateTeamMember(cmd *models.UpdateTeamMemberCommand) error
- func UpdateTempUserStatus(cmd *models.UpdateTempUserStatusCommand) error
- func UpdateTempUserWithEmailSent(cmd *models.UpdateTempUserWithEmailSentCommand) error
- func UpdateUser(cmd *models.UpdateUserCommand) error
- func UpdateUserLastSeenAt(cmd *models.UpdateUserLastSeenAtCommand) error
- func UpdateUserPermissions(cmd *models.UpdateUserPermissionsCommand) error
- func UpdateUserQuota(cmd *models.UpdateUserQuotaCmd) error
- func ValidateDashboardBeforeSave(cmd *models.ValidateDashboardBeforeSaveCommand) (err error)
- func WrapDatabaseDriverWithHooks(dbType string) string
- type AnnotationCleanupService
- type ContextSessionKey
- type DBSession
- type DashboardExtras
- type DashboardSearchProjection
- type DashboardSlugDTO
- type DashboardTag
- type DatabaseConfig
- type ITestDB
- type InitTestDBOpt
- type SQLAnnotationRepo
- type SQLBuilder
- func (sb *SQLBuilder) AddParams(params ...interface{})
- func (sb *SQLBuilder) GetParams() []interface{}
- func (sb *SQLBuilder) GetSQLString() string
- func (sb *SQLBuilder) Write(sql string, params ...interface{})
- func (sb *SQLBuilder) WriteDashboardPermissionFilter(user *models.SignedInUser, permission models.PermissionType)
- type SQLStore
- func (ss *SQLStore) CreateOrgWithMember(name string, userID int64) (models.Org, error)
- func (ss *SQLStore) DeleteDataSource(uid string, id int64, name string, orgID int64) (int64, error)
- func (ss *SQLStore) GetAlertNotificationUidWithId(query *models.GetAlertNotificationUidQuery) error
- func (ss *SQLStore) GetDataSource(uid string, id int64, name string, orgID int64) (*models.DataSource, error)
- func (ss *SQLStore) GetOrgByName(name string) (*models.Org, error)
- func (ss *SQLStore) GetPreferencesWithDefaults(query *models.GetPreferencesWithDefaultsQuery) error
- func (ss *SQLStore) GetSignedInUserWithCache(query *models.GetSignedInUserQuery) error
- func (ss *SQLStore) InTransaction(ctx context.Context, fn func(ctx context.Context) error) error
- func (ss *SQLStore) Init() error
- func (ss *SQLStore) NewSession() *DBSession
- func (ss *SQLStore) Register()
- func (ss *SQLStore) Reset() error
- func (ss *SQLStore) Sync() error
- func (ss *SQLStore) WithDbSession(ctx context.Context, callback dbTransactionFunc) error
- func (ss *SQLStore) WithTransactionalDbSession(ctx context.Context, callback dbTransactionFunc) error
- type XormLogger
- func (s *XormLogger) Debug(v ...interface{})
- func (s *XormLogger) Debugf(format string, v ...interface{})
- func (s *XormLogger) Error(v ...interface{})
- func (s *XormLogger) Errorf(format string, v ...interface{})
- func (s *XormLogger) Info(v ...interface{})
- func (s *XormLogger) Infof(format string, v ...interface{})
- func (s *XormLogger) IsShowSQL() bool
- func (s *XormLogger) Level() core.LogLevel
- func (s *XormLogger) SetLevel(l core.LogLevel)
- func (s *XormLogger) ShowSQL(show ...bool)
- func (s *XormLogger) Warn(v ...interface{})
- func (s *XormLogger) Warnf(format string, v ...interface{})
Constants ¶
const InitPriority = registry.High
const MAX_VERSIONS_TO_DELETE_PER_BATCH = 100
const MAX_VERSION_DELETION_BATCHES = 50
const MainOrgName = "Main Org."
MainOrgName is the name of the main organization.
const ServiceName = "SqlStore"
Variables ¶
This section is empty.
Functions ¶
func AddApiKey ¶
func AddApiKey(cmd *models.AddApiKeyCommand) error
func AddDataSource ¶
func AddDataSource(cmd *models.AddDataSourceCommand) error
func AddOrgUser ¶
func AddOrgUser(cmd *models.AddOrgUserCommand) error
func AddTeamMember ¶
func AddTeamMember(cmd *models.AddTeamMemberCommand) error
AddTeamMember adds a user to a team
func BatchDisableUsers ¶
func BatchDisableUsers(cmd *models.BatchDisableUsersCommand) error
func ChangeUserPassword ¶
func ChangeUserPassword(cmd *models.ChangeUserPasswordCommand) error
func CreateAlertNotificationCommand ¶
func CreateAlertNotificationCommand(cmd *models.CreateAlertNotificationCommand) error
func CreateDashboardSnapshot ¶
func CreateDashboardSnapshot(cmd *models.CreateDashboardSnapshotCommand) error
func CreateLoginAttempt ¶
func CreateLoginAttempt(cmd *models.CreateLoginAttemptCommand) error
func CreateOrg ¶
func CreateOrg(cmd *models.CreateOrgCommand) error
func CreatePlaylist ¶
func CreatePlaylist(cmd *models.CreatePlaylistCommand) error
func CreateTeam ¶
func CreateTeam(cmd *models.CreateTeamCommand) error
func CreateTempUser ¶
func CreateTempUser(cmd *models.CreateTempUserCommand) error
func CreateUser ¶
func CreateUser(ctx context.Context, cmd *models.CreateUserCommand) error
func DeleteAlertNotification ¶
func DeleteAlertNotification(cmd *models.DeleteAlertNotificationCommand) error
func DeleteAlertNotificationWithUid ¶
func DeleteAlertNotificationWithUid(cmd *models.DeleteAlertNotificationWithUidCommand) error
func DeleteApiKeyCtx ¶
func DeleteApiKeyCtx(ctx context.Context, cmd *models.DeleteApiKeyCommand) error
func DeleteAuthInfo ¶
func DeleteAuthInfo(cmd *models.DeleteAuthInfoCommand) error
func DeleteDashboard ¶
func DeleteDashboard(cmd *models.DeleteDashboardCommand) error
func DeleteDashboardSnapshot ¶
func DeleteDashboardSnapshot(cmd *models.DeleteDashboardSnapshotCommand) error
func DeleteDataSource ¶
func DeleteDataSource(cmd *models.DeleteDataSourceCommand) error
DeleteDataSource removes a datasource by org_id as well as either uid (preferred), id, or name and is added to the bus.
func DeleteExpiredSnapshots ¶
func DeleteExpiredSnapshots(cmd *models.DeleteExpiredSnapshotsCommand) error
DeleteExpiredSnapshots removes snapshots with old expiry dates. SnapShotRemoveExpired is deprecated and should be removed in the future. Snapshot expiry is decided by the user when they share the snapshot.
func DeleteExpiredVersions ¶
func DeleteExpiredVersions(cmd *models.DeleteExpiredVersionsCommand) error
func DeleteOldLoginAttempts ¶
func DeleteOldLoginAttempts(cmd *models.DeleteOldLoginAttemptsCommand) error
func DeleteOrg ¶
func DeleteOrg(cmd *models.DeleteOrgCommand) error
func DeleteOrphanedProvisionedDashboards ¶
func DeleteOrphanedProvisionedDashboards(cmd *models.DeleteOrphanedProvisionedDashboardsCommand) error
func DeletePlaylist ¶
func DeletePlaylist(cmd *models.DeletePlaylistCommand) error
func DeleteTeam ¶
func DeleteTeam(cmd *models.DeleteTeamCommand) error
DeleteTeam will delete a team, its member and any permissions connected to the team
func DeleteUser ¶
func DeleteUser(cmd *models.DeleteUserCommand) error
func DisableUser ¶
func DisableUser(cmd *models.DisableUserCommand) error
func EnsureTagsExist ¶
Will insert if needed any new key/value pars and return ids
func ExpireOldUserInvites ¶
func ExpireOldUserInvites(cmd *models.ExpireTempUsersCommand) error
func GetAdminStats ¶
func GetAdminStats(query *models.GetAdminStatsQuery) error
func GetAlertById ¶
func GetAlertById(query *models.GetAlertByIdQuery) error
func GetAlertNotifications ¶
func GetAlertNotifications(query *models.GetAlertNotificationsQuery) error
func GetAlertNotificationsWithUid ¶
func GetAlertNotificationsWithUid(query *models.GetAlertNotificationsWithUidQuery) error
func GetAlertNotificationsWithUidToSend ¶
func GetAlertNotificationsWithUidToSend(query *models.GetAlertNotificationsWithUidToSendQuery) error
func GetAlertNotifiersUsageStats ¶
func GetAlertNotifiersUsageStats(ctx context.Context, query *models.GetAlertNotifierUsageStatsQuery) error
func GetAlertStatesForDashboard ¶
func GetAlertStatesForDashboard(query *models.GetAlertStatesForDashboardQuery) error
func GetAlertsByDashboardId2 ¶
func GetAllAlertNotifications ¶
func GetAllAlertNotifications(query *models.GetAllAlertNotificationsQuery) error
func GetAllAlertQueryHandler ¶
func GetAllAlertQueryHandler(query *models.GetAllAlertsQuery) error
func GetApiKeyById ¶
func GetApiKeyById(query *models.GetApiKeyByIdQuery) error
func GetApiKeyByName ¶
func GetApiKeyByName(query *models.GetApiKeyByNameQuery) error
func GetApiKeys ¶
func GetApiKeys(query *models.GetApiKeysQuery) error
func GetAuthInfo ¶
func GetAuthInfo(query *models.GetAuthInfoQuery) error
func GetDBHealthQuery ¶
func GetDBHealthQuery(query *models.GetDBHealthQuery) error
func GetDashboard ¶
func GetDashboard(query *models.GetDashboardQuery) error
func GetDashboardAclInfoList ¶
func GetDashboardAclInfoList(query *models.GetDashboardAclInfoListQuery) error
GetDashboardAclInfoList returns a list of permissions for a dashboard. They can be fetched from three different places. 1) Permissions for the dashboard 2) permissions for its parent folder 3) if no specific permissions have been set for the dashboard or its parent folder then get the default permissions
func GetDashboardPermissionsForUser ¶
func GetDashboardPermissionsForUser(query *models.GetDashboardPermissionsForUserQuery) error
GetDashboardPermissionsForUser returns the maximum permission the specified user has for a dashboard(s) The function takes in a list of dashboard ids and the user id and role
func GetDashboardSlugById ¶
func GetDashboardSlugById(query *models.GetDashboardSlugByIdQuery) error
func GetDashboardSnapshot ¶
func GetDashboardSnapshot(query *models.GetDashboardSnapshotQuery) error
func GetDashboardTags ¶
func GetDashboardTags(query *models.GetDashboardTagsQuery) error
func GetDashboardUIDById ¶
func GetDashboardUIDById(query *models.GetDashboardRefByIdQuery) error
func GetDashboardVersion ¶
func GetDashboardVersion(query *models.GetDashboardVersionQuery) error
GetDashboardVersion gets the dashboard version for the given dashboard ID and version number.
func GetDashboardVersions ¶
func GetDashboardVersions(query *models.GetDashboardVersionsQuery) error
GetDashboardVersions gets all dashboard versions for the given dashboard ID.
func GetDashboards ¶
func GetDashboards(query *models.GetDashboardsQuery) error
func GetDashboardsByPluginId ¶
func GetDashboardsByPluginId(query *models.GetDashboardsByPluginIdQuery) error
func GetDashboardsBySlug ¶
func GetDashboardsBySlug(query *models.GetDashboardsBySlugQuery) error
func GetDataSource ¶
func GetDataSource(query *models.GetDataSourceQuery) error
GetDataSource adds a datasource to the query model by querying by org_id as well as either uid (preferred), id, or name and is added to the bus.
func GetDataSourceAccessStats ¶
func GetDataSourceAccessStats(query *models.GetDataSourceAccessStatsQuery) error
func GetDataSourceStats ¶
func GetDataSourceStats(query *models.GetDataSourceStatsQuery) error
func GetDataSources ¶
func GetDataSources(query *models.GetDataSourcesQuery) error
func GetDataSourcesByType ¶
func GetDataSourcesByType(query *models.GetDataSourcesByTypeQuery) error
GetDataSourcesByType returns all datasources for a given type or an error if the specified type is an empty string
func GetDefaultDataSource ¶
func GetDefaultDataSource(query *models.GetDefaultDataSourceQuery) error
GetDefaultDataSource is used to get the default datasource of organization
func GetExternalUserInfoByLogin ¶
func GetExternalUserInfoByLogin(query *models.GetExternalUserInfoByLoginQuery) error
func GetGlobalQuotaByTarget ¶
func GetGlobalQuotaByTarget(query *models.GetGlobalQuotaByTargetQuery) error
func GetOrCreateAlertNotificationState ¶
func GetOrCreateAlertNotificationState(ctx context.Context, cmd *models.GetOrCreateNotificationStateQuery) error
func GetOrgById ¶
func GetOrgById(query *models.GetOrgByIdQuery) error
func GetOrgByName ¶
func GetOrgByName(query *models.GetOrgByNameQuery) error
func GetOrgQuotaByTarget ¶
func GetOrgQuotaByTarget(query *models.GetOrgQuotaByTargetQuery) error
func GetOrgQuotas ¶
func GetOrgQuotas(query *models.GetOrgQuotasQuery) error
func GetOrgUsers ¶
func GetOrgUsers(query *models.GetOrgUsersQuery) error
func GetPlaylist ¶
func GetPlaylist(query *models.GetPlaylistByIdQuery) error
func GetPlaylistItem ¶
func GetPlaylistItem(query *models.GetPlaylistItemsByIdQuery) error
func GetPluginSettingById ¶
func GetPluginSettingById(query *models.GetPluginSettingByIdQuery) error
func GetPluginSettings ¶
func GetPluginSettings(query *models.GetPluginSettingsQuery) error
func GetPreferences ¶
func GetPreferences(query *models.GetPreferencesQuery) error
func GetProvisionedDashboardDataQuery ¶
func GetProvisionedDashboardDataQuery(cmd *models.GetProvisionedDashboardDataQuery) error
func GetProvisionedDataByDashboardId ¶
func GetProvisionedDataByDashboardId(cmd *models.GetProvisionedDashboardDataByIdQuery) error
func GetSignedInUser ¶
func GetSignedInUser(query *models.GetSignedInUserQuery) error
func GetSystemStats ¶
func GetSystemStats(query *models.GetSystemStatsQuery) error
func GetSystemUserCountStats ¶
func GetSystemUserCountStats(ctx context.Context, query *models.GetSystemUserCountStatsQuery) error
func GetTeamById ¶
func GetTeamById(query *models.GetTeamByIdQuery) error
func GetTeamMembers ¶
func GetTeamMembers(query *models.GetTeamMembersQuery) error
GetTeamMembers return a list of members for the specified team
func GetTeamsByUser ¶
func GetTeamsByUser(query *models.GetTeamsByUserQuery) error
GetTeamsByUser is used by the Guardian when checking a users' permissions
func GetTempUserByCode ¶
func GetTempUserByCode(query *models.GetTempUserByCodeQuery) error
func GetTempUsersQuery ¶
func GetTempUsersQuery(query *models.GetTempUsersQuery) error
func GetUserByAuthInfo ¶
func GetUserByAuthInfo(query *models.GetUserByAuthInfoQuery) error
func GetUserByEmail ¶
func GetUserByEmail(query *models.GetUserByEmailQuery) error
func GetUserById ¶
func GetUserById(query *models.GetUserByIdQuery) error
func GetUserByLogin ¶
func GetUserByLogin(query *models.GetUserByLoginQuery) error
func GetUserLoginAttemptCount ¶
func GetUserLoginAttemptCount(query *models.GetUserLoginAttemptCountQuery) error
func GetUserOrgList ¶
func GetUserOrgList(query *models.GetUserOrgListQuery) error
func GetUserProfile ¶
func GetUserProfile(query *models.GetUserProfileQuery) error
func GetUserQuotaByTarget ¶
func GetUserQuotaByTarget(query *models.GetUserQuotaByTargetQuery) error
func GetUserQuotas ¶
func GetUserQuotas(query *models.GetUserQuotasQuery) error
func GetUserStars ¶
func GetUserStars(query *models.GetUserStarsQuery) error
func HandleAlertsQuery ¶
func HandleAlertsQuery(query *models.GetAlertsQuery) error
func HasAdminPermissionInFolders ¶
func HasAdminPermissionInFolders(query *models.HasAdminPermissionInFoldersQuery) error
func HasEditPermissionInFolders ¶
func HasEditPermissionInFolders(query *models.HasEditPermissionInFoldersQuery) error
func InsertSQLTestData ¶
func InsertSQLTestData(cmd *models.InsertSQLTestDataCommand) error
func IsAdminOfTeams ¶
func IsAdminOfTeams(query *models.IsAdminOfTeamsQuery) error
func IsStarredByUser ¶
func IsStarredByUser(query *models.IsStarredByUserQuery) error
func IsTestDbMySQL ¶
func IsTestDbMySQL() bool
func IsTestDbPostgres ¶
func IsTestDbPostgres() bool
func PauseAlert ¶
func PauseAlert(cmd *models.PauseAlertCommand) error
func PauseAllAlerts ¶
func PauseAllAlerts(cmd *models.PauseAllAlertCommand) error
func RemoveOrgUser ¶
func RemoveOrgUser(cmd *models.RemoveOrgUserCommand) error
func RemoveTeamMember ¶
func RemoveTeamMember(cmd *models.RemoveTeamMemberCommand) error
RemoveTeamMember removes a member from a team
func SaveAlerts ¶
func SaveAlerts(cmd *models.SaveAlertsCommand) error
func SaveDashboard ¶
func SaveDashboard(cmd *models.SaveDashboardCommand) error
func SavePreferences ¶
func SavePreferences(cmd *models.SavePreferencesCommand) error
func SaveProvisionedDashboard ¶
func SaveProvisionedDashboard(cmd *models.SaveProvisionedDashboardCommand) error
func SearchDashboardSnapshots ¶
func SearchDashboardSnapshots(query *models.GetDashboardSnapshotsQuery) error
SearchDashboardSnapshots returns a list of all snapshots for admins for other roles, it returns snapshots created by the user
func SearchDashboards ¶
func SearchDashboards(query *search.FindPersistedDashboardsQuery) error
func SearchOrgs ¶
func SearchOrgs(query *models.SearchOrgsQuery) error
func SearchPlaylists ¶
func SearchPlaylists(query *models.GetPlaylistsQuery) error
func SearchTeams ¶
func SearchTeams(query *models.SearchTeamsQuery) error
func SearchUsers ¶
func SearchUsers(query *models.SearchUsersQuery) error
func SetAlertNotificationStateToCompleteCommand ¶
func SetAlertNotificationStateToCompleteCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToCompleteCommand) error
func SetAlertNotificationStateToPendingCommand ¶
func SetAlertNotificationStateToPendingCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToPendingCommand) error
func SetAlertState ¶
func SetAlertState(cmd *models.SetAlertStateCommand) error
func SetAuthInfo ¶
func SetAuthInfo(cmd *models.SetAuthInfoCommand) error
func SetUserHelpFlag ¶
func SetUserHelpFlag(cmd *models.SetUserHelpFlagCommand) error
func SetUsingOrg ¶
func SetUsingOrg(cmd *models.SetUsingOrgCommand) error
func StarDashboard ¶
func StarDashboard(cmd *models.StarDashboardCommand) error
func UnprovisionDashboard ¶
func UnprovisionDashboard(cmd *models.UnprovisionDashboardCommand) error
UnprovisionDashboard removes row in dashboard_provisioning for the dashboard making it seem as if manually created. The dashboard will still have `created_by = -1` to see it was not created by any particular user.
func UnstarDashboard ¶
func UnstarDashboard(cmd *models.UnstarDashboardCommand) error
func UpdateAlertNotification ¶
func UpdateAlertNotification(cmd *models.UpdateAlertNotificationCommand) error
func UpdateAlertNotificationWithUid ¶
func UpdateAlertNotificationWithUid(cmd *models.UpdateAlertNotificationWithUidCommand) error
func UpdateAuthInfo ¶
func UpdateAuthInfo(cmd *models.UpdateAuthInfoCommand) error
func UpdateDashboardAcl ¶
func UpdateDashboardAcl(cmd *models.UpdateDashboardAclCommand) error
func UpdateDataSource ¶
func UpdateDataSource(cmd *models.UpdateDataSourceCommand) error
func UpdateOrg ¶
func UpdateOrg(cmd *models.UpdateOrgCommand) error
func UpdateOrgAddress ¶
func UpdateOrgAddress(cmd *models.UpdateOrgAddressCommand) error
func UpdateOrgQuota ¶
func UpdateOrgQuota(cmd *models.UpdateOrgQuotaCmd) error
func UpdateOrgUser ¶
func UpdateOrgUser(cmd *models.UpdateOrgUserCommand) error
func UpdatePlaylist ¶
func UpdatePlaylist(cmd *models.UpdatePlaylistCommand) error
func UpdatePluginSetting ¶
func UpdatePluginSetting(cmd *models.UpdatePluginSettingCmd) error
func UpdatePluginSettingVersion ¶
func UpdatePluginSettingVersion(cmd *models.UpdatePluginSettingVersionCmd) error
func UpdateTeam ¶
func UpdateTeam(cmd *models.UpdateTeamCommand) error
func UpdateTeamMember ¶
func UpdateTeamMember(cmd *models.UpdateTeamMemberCommand) error
UpdateTeamMember updates a team member
func UpdateTempUserStatus ¶
func UpdateTempUserStatus(cmd *models.UpdateTempUserStatusCommand) error
func UpdateTempUserWithEmailSent ¶
func UpdateTempUserWithEmailSent(cmd *models.UpdateTempUserWithEmailSentCommand) error
func UpdateUser ¶
func UpdateUser(cmd *models.UpdateUserCommand) error
func UpdateUserLastSeenAt ¶
func UpdateUserLastSeenAt(cmd *models.UpdateUserLastSeenAtCommand) error
func UpdateUserPermissions ¶
func UpdateUserPermissions(cmd *models.UpdateUserPermissionsCommand) error
func UpdateUserQuota ¶
func UpdateUserQuota(cmd *models.UpdateUserQuotaCmd) error
func ValidateDashboardBeforeSave ¶
func ValidateDashboardBeforeSave(cmd *models.ValidateDashboardBeforeSaveCommand) (err error)
func WrapDatabaseDriverWithHooks ¶
WrapDatabaseDriverWithHooks creates a fake database driver that executes pre and post functions which we use to gather metrics about database queries. It also registers the metrics.
Types ¶
type AnnotationCleanupService ¶
type AnnotationCleanupService struct {
// contains filtered or unexported fields
}
AnnotationCleanupService is responsible for cleaning old annotations.
func (*AnnotationCleanupService) CleanAnnotations ¶
func (acs *AnnotationCleanupService) CleanAnnotations(ctx context.Context, cfg *setting.Cfg) (int64, int64, error)
CleanAnnotations deletes old annotations created by alert rules, API requests and human made in the UI. It subsequently deletes orphaned rows from the annotation_tag table. Cleanup actions are performed in batches so that no query takes too long to complete.
Returns the number of annotation and annotation_tag rows deleted. If an error occurs, it returns the number of rows affected so far.
type ContextSessionKey ¶
type ContextSessionKey struct{}
ContextSessionKey is used as key to save values in `context.Context`
type DashboardExtras ¶
type DashboardSlugDTO ¶
type DashboardSlugDTO struct {
Slug string
}
type DashboardTag ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Type string Host string Name string User string Pwd string Path string SslMode string CaCertPath string ClientKeyPath string ClientCertPath string ServerCertName string ConnectionString string IsolationLevel string MaxOpenConn int MaxIdleConn int ConnMaxLifetime int CacheMode string UrlQueryParams map[string][]string SkipMigrations bool }
type ITestDB ¶
type ITestDB interface { Helper() Fatalf(format string, args ...interface{}) Logf(format string, args ...interface{}) Log(args ...interface{}) }
ITestDB is an interface of arguments for testing db
type InitTestDBOpt ¶
type InitTestDBOpt struct { // EnsureDefaultOrgAndUser flags whether to ensure that default org and user exist. EnsureDefaultOrgAndUser bool }
InitTestDBOpt contains options for InitTestDB.
type SQLAnnotationRepo ¶
type SQLAnnotationRepo struct { }
func (*SQLAnnotationRepo) Delete ¶
func (r *SQLAnnotationRepo) Delete(params *annotations.DeleteParams) error
func (*SQLAnnotationRepo) Find ¶
func (r *SQLAnnotationRepo) Find(query *annotations.ItemQuery) ([]*annotations.ItemDTO, error)
func (*SQLAnnotationRepo) Save ¶
func (r *SQLAnnotationRepo) Save(item *annotations.Item) error
func (*SQLAnnotationRepo) Update ¶
func (r *SQLAnnotationRepo) Update(item *annotations.Item) error
type SQLBuilder ¶
type SQLBuilder struct {
// contains filtered or unexported fields
}
func (*SQLBuilder) AddParams ¶
func (sb *SQLBuilder) AddParams(params ...interface{})
func (*SQLBuilder) GetParams ¶
func (sb *SQLBuilder) GetParams() []interface{}
func (*SQLBuilder) GetSQLString ¶
func (sb *SQLBuilder) GetSQLString() string
func (*SQLBuilder) Write ¶
func (sb *SQLBuilder) Write(sql string, params ...interface{})
func (*SQLBuilder) WriteDashboardPermissionFilter ¶
func (sb *SQLBuilder) WriteDashboardPermissionFilter(user *models.SignedInUser, permission models.PermissionType)
type SQLStore ¶
type SQLStore struct { Cfg *setting.Cfg `inject:""` Bus bus.Bus `inject:""` CacheService *localcache.CacheService `inject:""` Dialect migrator.Dialect // contains filtered or unexported fields }
func InitTestDB ¶
func InitTestDB(t ITestDB, opts ...InitTestDBOpt) *SQLStore
InitTestDB initializes the test DB.
func (*SQLStore) CreateOrgWithMember ¶
CreateOrgWithMember creates an organization with a certain name and a certain user as member.
func (*SQLStore) DeleteDataSource ¶
DeleteDataSource deletes a datasource by org_id and either uid (preferred), id, or name. Zero values (0, or "") should be used for the parameters that will not be queried.
func (*SQLStore) GetAlertNotificationUidWithId ¶
func (ss *SQLStore) GetAlertNotificationUidWithId(query *models.GetAlertNotificationUidQuery) error
func (*SQLStore) GetDataSource ¶
func (ss *SQLStore) GetDataSource(uid string, id int64, name string, orgID int64) (*models.DataSource, error)
GetDataSource returns a datasource by org_id and either uid (preferred), id, or name. Zero values (0, or "") should be used for the parameters that will not be queried.
func (*SQLStore) GetOrgByName ¶
GetOrgByName gets an organization by name.
func (*SQLStore) GetPreferencesWithDefaults ¶
func (ss *SQLStore) GetPreferencesWithDefaults(query *models.GetPreferencesWithDefaultsQuery) error
func (*SQLStore) GetSignedInUserWithCache ¶
func (ss *SQLStore) GetSignedInUserWithCache(query *models.GetSignedInUserQuery) error
func (*SQLStore) InTransaction ¶
func (*SQLStore) NewSession ¶
NewSession returns a new DBSession
func (*SQLStore) Register ¶
func (ss *SQLStore) Register()
Register registers the SQLStore service with the DI system.
func (*SQLStore) Reset ¶
Reset resets database state. If default org and user creation is enabled, it will be ensured they exist in the database.
func (*SQLStore) WithDbSession ¶
WithDbSession calls the callback with a session.
type XormLogger ¶
type XormLogger struct {
// contains filtered or unexported fields
}
func NewXormLogger ¶
func NewXormLogger(level glog.Lvl, grafargLog glog.Logger) *XormLogger
func (*XormLogger) Debug ¶
func (s *XormLogger) Debug(v ...interface{})
Debug implement core.ILogger
func (*XormLogger) Debugf ¶
func (s *XormLogger) Debugf(format string, v ...interface{})
Debugf implement core.ILogger
func (*XormLogger) Error ¶
func (s *XormLogger) Error(v ...interface{})
Error implement core.ILogger
func (*XormLogger) Errorf ¶
func (s *XormLogger) Errorf(format string, v ...interface{})
Errorf implement core.ILogger
func (*XormLogger) Infof ¶
func (s *XormLogger) Infof(format string, v ...interface{})
Infof implement core.ILogger
func (*XormLogger) IsShowSQL ¶
func (s *XormLogger) IsShowSQL() bool
IsShowSQL implement core.ILogger
func (*XormLogger) SetLevel ¶
func (s *XormLogger) SetLevel(l core.LogLevel)
SetLevel implement core.ILogger
func (*XormLogger) ShowSQL ¶
func (s *XormLogger) ShowSQL(show ...bool)
ShowSQL implement core.ILogger
func (*XormLogger) Warnf ¶
func (s *XormLogger) Warnf(format string, v ...interface{})
Warnf implement core.ILogger
Source Files ¶
- alert.go
- alert_notification.go
- annotation.go
- annotation_cleanup.go
- apikey.go
- dashboard.go
- dashboard_acl.go
- dashboard_provisioning.go
- dashboard_snapshot.go
- dashboard_version.go
- database_wrapper.go
- datasource.go
- health.go
- logger.go
- login_attempt.go
- org.go
- org_users.go
- playlist.go
- plugin_setting.go
- preferences.go
- quota.go
- session.go
- sql_test_data.go
- sqlbuilder.go
- sqlstore.go
- star.go
- stats.go
- tables.go
- tags.go
- team.go
- temp_user.go
- tls_mysql.go
- transactions.go
- user.go
- user_auth.go
Directories ¶
Path | Synopsis |
---|---|
Package searchstore converts search queries to SQL.
|
Package searchstore converts search queries to SQL. |