Documentation
¶
Index ¶
- Constants
- func AddOrUpdateTeamMemberHook(sess *DBSession, userID, orgID, teamID int64, isExternal bool, ...) error
- func CreateOrg(ctx context.Context, cmd *models.CreateOrgCommand) error
- func EnsureTagsExist(sess *DBSession, tags []*models.Tag) ([]*models.Tag, error)
- func GetAlertsByDashboardId2(dashboardId int64, sess *DBSession) ([]*models.Alert, error)
- func IsAdminOfTeams(ctx context.Context, query *models.IsAdminOfTeamsQuery) error
- func IsTestDBMSSQL() bool
- func IsTestDbMySQL() bool
- func IsTestDbPostgres() bool
- func RemoveTeamMemberHook(sess *DBSession, cmd *models.RemoveTeamMemberCommand) error
- func UserDeletions() []string
- func WrapDatabaseDriverWithHooks(dbType string, tracer tracing.Tracer) string
- type AlertNotificationStore
- type AnnotationCleanupService
- type ContextSessionKey
- type DBSession
- type DBTransactionFunc
- type DashboardSearchProjection
- type DashboardSlugDTO
- type DashboardTag
- type DatabaseConfig
- type ITestDB
- type InitTestDBOpt
- type SQLAnnotationRepo
- func (r *SQLAnnotationRepo) Delete(ctx context.Context, params *annotations.DeleteParams) error
- func (r *SQLAnnotationRepo) Find(ctx context.Context, query *annotations.ItemQuery) ([]*annotations.ItemDTO, error)
- func (r *SQLAnnotationRepo) FindTags(ctx context.Context, query *annotations.TagsQuery) (annotations.FindTagsResult, error)
- func (r *SQLAnnotationRepo) Save(item *annotations.Item) error
- func (r *SQLAnnotationRepo) Update(ctx context.Context, item *annotations.Item) error
- 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 InitTestDB(t ITestDB, opts ...InitTestDBOpt) *SQLStore
- func InitTestDBWithMigration(t ITestDB, migration registry.DatabaseMigrator, opts ...InitTestDBOpt) *SQLStore
- func ProvideService(cfg *setting.Cfg, cacheService *localcache.CacheService, ...) (*SQLStore, error)
- func ProvideServiceForTests(migrations registry.DatabaseMigrator) (*SQLStore, error)
- func (ss *SQLStore) AddAPIKey(ctx context.Context, cmd *models.AddApiKeyCommand) error
- func (ss *SQLStore) AddDataSource(ctx context.Context, cmd *models.AddDataSourceCommand) error
- func (ss *SQLStore) AddOrgUser(ctx context.Context, cmd *models.AddOrgUserCommand) error
- func (ss *SQLStore) AddTeamMember(userID, orgID, teamID int64, isExternal bool, permission models.PermissionType) error
- func (ss *SQLStore) BatchDisableUsers(ctx context.Context, cmd *models.BatchDisableUsersCommand) error
- func (ss *SQLStore) ChangeUserPassword(ctx context.Context, cmd *models.ChangeUserPasswordCommand) error
- func (ss *SQLStore) CreateAlertNotificationCommand(ctx context.Context, cmd *models.CreateAlertNotificationCommand) error
- func (ss *SQLStore) CreateDashboardSnapshot(ctx context.Context, cmd *models.CreateDashboardSnapshotCommand) error
- func (ss *SQLStore) CreateLoginAttempt(ctx context.Context, cmd *models.CreateLoginAttemptCommand) error
- func (ss *SQLStore) CreateOrgWithMember(name string, userID int64) (models.Org, error)
- func (ss *SQLStore) CreatePlaylist(ctx context.Context, cmd *models.CreatePlaylistCommand) error
- func (ss *SQLStore) CreateTeam(name, email string, orgID int64) (models.Team, error)
- func (ss *SQLStore) CreateTempUser(ctx context.Context, cmd *models.CreateTempUserCommand) error
- func (ss *SQLStore) CreateUser(ctx context.Context, cmd models.CreateUserCommand) (*models.User, error)
- func (ss *SQLStore) DeleteAlertNotification(ctx context.Context, cmd *models.DeleteAlertNotificationCommand) error
- func (ss *SQLStore) DeleteAlertNotificationWithUid(ctx context.Context, cmd *models.DeleteAlertNotificationWithUidCommand) error
- func (ss *SQLStore) DeleteApiKey(ctx context.Context, cmd *models.DeleteApiKeyCommand) error
- func (ss *SQLStore) DeleteDashboardSnapshot(ctx context.Context, cmd *models.DeleteDashboardSnapshotCommand) error
- func (ss *SQLStore) DeleteDataSource(ctx context.Context, cmd *models.DeleteDataSourceCommand) error
- func (ss *SQLStore) DeleteExpiredSnapshots(ctx context.Context, cmd *models.DeleteExpiredSnapshotsCommand) error
- func (ss *SQLStore) DeleteExpiredVersions(ctx context.Context, cmd *models.DeleteExpiredVersionsCommand) error
- func (ss *SQLStore) DeleteOldLoginAttempts(ctx context.Context, cmd *models.DeleteOldLoginAttemptsCommand) error
- func (ss *SQLStore) DeleteOrg(ctx context.Context, cmd *models.DeleteOrgCommand) error
- func (ss *SQLStore) DeletePlaylist(ctx context.Context, cmd *models.DeletePlaylistCommand) error
- func (ss *SQLStore) DeleteTeam(ctx context.Context, cmd *models.DeleteTeamCommand) error
- func (ss *SQLStore) DeleteUser(ctx context.Context, cmd *models.DeleteUserCommand) error
- func (ss *SQLStore) DisableUser(ctx context.Context, cmd *models.DisableUserCommand) error
- func (ss *SQLStore) ExpireOldUserInvites(ctx context.Context, cmd *models.ExpireTempUsersCommand) error
- func (ss *SQLStore) FindDashboards(ctx context.Context, query *models.FindPersistedDashboardsQuery) ([]DashboardSearchProjection, error)
- func (ss *SQLStore) FindDashboardsWithStaleThumbnails(ctx context.Context, cmd *models.FindDashboardsWithStaleThumbnailsCommand) ([]*models.DashboardWithStaleThumbnail, error)
- func (ss *SQLStore) FindThumbnailCount(ctx context.Context, cmd *models.FindDashboardThumbnailCountCommand) (int64, error)
- func (ss *SQLStore) GetAPIKeys(ctx context.Context, query *models.GetApiKeysQuery) error
- func (ss *SQLStore) GetAdminStats(ctx context.Context, query *models.GetAdminStatsQuery) error
- func (ss *SQLStore) GetAlertById(ctx context.Context, query *models.GetAlertByIdQuery) error
- func (ss *SQLStore) GetAlertNotificationUidWithId(ctx context.Context, query *models.GetAlertNotificationUidQuery) error
- func (ss *SQLStore) GetAlertNotifications(ctx context.Context, query *models.GetAlertNotificationsQuery) error
- func (ss *SQLStore) GetAlertNotificationsWithUid(ctx context.Context, query *models.GetAlertNotificationsWithUidQuery) error
- func (ss *SQLStore) GetAlertNotificationsWithUidToSend(ctx context.Context, query *models.GetAlertNotificationsWithUidToSendQuery) error
- func (ss *SQLStore) GetAlertNotifiersUsageStats(ctx context.Context, query *models.GetAlertNotifierUsageStatsQuery) error
- func (ss *SQLStore) GetAlertStatesForDashboard(ctx context.Context, query *models.GetAlertStatesForDashboardQuery) error
- func (ss *SQLStore) GetAllAlertNotifications(ctx context.Context, query *models.GetAllAlertNotificationsQuery) error
- func (ss *SQLStore) GetAllAlertQueryHandler(ctx context.Context, query *models.GetAllAlertsQuery) error
- func (ss *SQLStore) GetAllOrgsAPIKeys(ctx context.Context) []*models.ApiKey
- func (ss *SQLStore) GetApiKeyById(ctx context.Context, query *models.GetApiKeyByIdQuery) error
- func (ss *SQLStore) GetApiKeyByName(ctx context.Context, query *models.GetApiKeyByNameQuery) error
- func (ss *SQLStore) GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error
- func (ss *SQLStore) GetDashboard(ctx context.Context, query *models.GetDashboardQuery) error
- func (ss *SQLStore) GetDashboardAclInfoList(ctx context.Context, query *models.GetDashboardAclInfoListQuery) error
- func (ss *SQLStore) GetDashboardPermissionsForUser(ctx context.Context, query *models.GetDashboardPermissionsForUserQuery) error
- func (ss *SQLStore) GetDashboardSlugById(ctx context.Context, query *models.GetDashboardSlugByIdQuery) error
- func (ss *SQLStore) GetDashboardSnapshot(query *models.GetDashboardSnapshotQuery) error
- func (ss *SQLStore) GetDashboardTags(ctx context.Context, query *models.GetDashboardTagsQuery) error
- func (ss *SQLStore) GetDashboardUIDById(ctx context.Context, query *models.GetDashboardRefByIdQuery) error
- func (ss *SQLStore) GetDashboardVersion(ctx context.Context, query *models.GetDashboardVersionQuery) error
- func (ss *SQLStore) GetDashboardVersions(ctx context.Context, query *models.GetDashboardVersionsQuery) error
- func (ss *SQLStore) GetDashboards(ctx context.Context, query *models.GetDashboardsQuery) error
- func (ss *SQLStore) GetDataSource(ctx context.Context, query *models.GetDataSourceQuery) error
- func (ss *SQLStore) GetDataSourceAccessStats(ctx context.Context, query *models.GetDataSourceAccessStatsQuery) error
- func (ss *SQLStore) GetDataSourceStats(ctx context.Context, query *models.GetDataSourceStatsQuery) error
- func (ss *SQLStore) GetDataSources(ctx context.Context, query *models.GetDataSourcesQuery) error
- func (ss *SQLStore) GetDataSourcesByType(ctx context.Context, query *models.GetDataSourcesByTypeQuery) error
- func (ss *SQLStore) GetDefaultDataSource(ctx context.Context, query *models.GetDefaultDataSourceQuery) error
- func (ss *SQLStore) GetDialect() migrator.Dialect
- func (ss *SQLStore) GetGlobalQuotaByTarget(ctx context.Context, query *models.GetGlobalQuotaByTargetQuery) error
- func (ss *SQLStore) GetOrCreateAlertNotificationState(ctx context.Context, cmd *models.GetOrCreateNotificationStateQuery) error
- func (ss *SQLStore) GetOrgById(ctx context.Context, query *models.GetOrgByIdQuery) error
- func (ss *SQLStore) GetOrgByName(name string) (*models.Org, error)
- func (ss *SQLStore) GetOrgByNameHandler(ctx context.Context, query *models.GetOrgByNameQuery) error
- func (ss *SQLStore) GetOrgQuotaByTarget(ctx context.Context, query *models.GetOrgQuotaByTargetQuery) error
- func (ss *SQLStore) GetOrgQuotas(ctx context.Context, query *models.GetOrgQuotasQuery) error
- func (ss *SQLStore) GetOrgUsers(ctx context.Context, query *models.GetOrgUsersQuery) error
- func (ss *SQLStore) GetPlaylist(ctx context.Context, query *models.GetPlaylistByIdQuery) error
- func (ss *SQLStore) GetPlaylistItem(ctx context.Context, query *models.GetPlaylistItemsByIdQuery) error
- func (ss *SQLStore) GetPluginSettingById(ctx context.Context, query *models.GetPluginSettingByIdQuery) error
- func (ss *SQLStore) GetPluginSettings(ctx context.Context, orgID int64) ([]*models.PluginSetting, error)
- func (ss *SQLStore) GetPreferences(ctx context.Context, query *models.GetPreferencesQuery) error
- func (ss *SQLStore) GetPreferencesWithDefaults(ctx context.Context, query *models.GetPreferencesWithDefaultsQuery) error
- func (ss *SQLStore) GetSignedInUser(ctx context.Context, query *models.GetSignedInUserQuery) error
- func (ss *SQLStore) GetSignedInUserWithCacheCtx(ctx context.Context, query *models.GetSignedInUserQuery) error
- func (ss *SQLStore) GetSystemStats(ctx context.Context, query *models.GetSystemStatsQuery) error
- func (ss *SQLStore) GetSystemUserCountStats(ctx context.Context, query *models.GetSystemUserCountStatsQuery) error
- func (ss *SQLStore) GetTeamById(ctx context.Context, query *models.GetTeamByIdQuery) error
- func (ss *SQLStore) GetTeamMembers(ctx context.Context, query *models.GetTeamMembersQuery) error
- func (ss *SQLStore) GetTeamsByUser(ctx context.Context, query *models.GetTeamsByUserQuery) error
- func (ss *SQLStore) GetTempUserByCode(ctx context.Context, query *models.GetTempUserByCodeQuery) error
- func (ss *SQLStore) GetTempUsersQuery(ctx context.Context, query *models.GetTempUsersQuery) error
- func (ss *SQLStore) GetThumbnail(ctx context.Context, query *models.GetDashboardThumbnailCommand) (*models.DashboardThumbnail, error)
- func (ss *SQLStore) GetUserByEmail(ctx context.Context, query *models.GetUserByEmailQuery) error
- func (ss *SQLStore) GetUserById(ctx context.Context, query *models.GetUserByIdQuery) error
- func (ss *SQLStore) GetUserByLogin(ctx context.Context, query *models.GetUserByLoginQuery) error
- func (ss *SQLStore) GetUserLoginAttemptCount(ctx context.Context, query *models.GetUserLoginAttemptCountQuery) error
- func (ss *SQLStore) GetUserOrgList(ctx context.Context, query *models.GetUserOrgListQuery) error
- func (ss *SQLStore) GetUserProfile(ctx context.Context, query *models.GetUserProfileQuery) error
- func (ss *SQLStore) GetUserQuotaByTarget(ctx context.Context, query *models.GetUserQuotaByTargetQuery) error
- func (ss *SQLStore) GetUserQuotas(ctx context.Context, query *models.GetUserQuotasQuery) error
- func (ss *SQLStore) GetUserStars(ctx context.Context, query *models.GetUserStarsQuery) error
- func (ss *SQLStore) GetUserTeamMemberships(ctx context.Context, orgID, userID int64, external bool) ([]*models.TeamMemberDTO, error)
- func (ss *SQLStore) HandleAlertsQuery(ctx context.Context, query *models.GetAlertsQuery) error
- func (ss *SQLStore) HasAdminPermissionInDashboardsOrFolders(ctx context.Context, ...) error
- func (ss *SQLStore) HasEditPermissionInFolders(ctx context.Context, query *models.HasEditPermissionInFoldersQuery) error
- func (ss *SQLStore) InTransaction(ctx context.Context, fn func(ctx context.Context) error) error
- func (ss *SQLStore) IsStarredByUserCtx(ctx context.Context, query *models.IsStarredByUserQuery) error
- func (ss *SQLStore) IsTeamMember(orgId int64, teamId int64, userId int64) (bool, error)
- func (ss *SQLStore) Migrate(isDatabaseLockingEnabled bool) error
- func (ss *SQLStore) NewSession(ctx context.Context) *DBSession
- func (ss *SQLStore) PatchPreferences(ctx context.Context, cmd *models.PatchPreferencesCommand) error
- func (ss *SQLStore) PauseAlert(ctx context.Context, cmd *models.PauseAlertCommand) error
- func (ss *SQLStore) PauseAllAlerts(ctx context.Context, cmd *models.PauseAllAlertCommand) error
- func (ss *SQLStore) Quote(value string) string
- func (ss *SQLStore) RemoveOrgUser(ctx context.Context, cmd *models.RemoveOrgUserCommand) error
- func (ss *SQLStore) RemoveTeamMember(ctx context.Context, cmd *models.RemoveTeamMemberCommand) error
- func (ss *SQLStore) Reset() error
- func (ss *SQLStore) SaveAlerts(ctx context.Context, dashID int64, alerts []*models.Alert) error
- func (ss *SQLStore) SavePreferences(ctx context.Context, cmd *models.SavePreferencesCommand) error
- func (ss *SQLStore) SaveThumbnail(ctx context.Context, cmd *models.SaveDashboardThumbnailCommand) (*models.DashboardThumbnail, error)
- func (ss *SQLStore) SearchDashboardSnapshots(query *models.GetDashboardSnapshotsQuery) error
- func (ss *SQLStore) SearchDashboards(ctx context.Context, query *models.FindPersistedDashboardsQuery) error
- func (ss *SQLStore) SearchOrgUsers(ctx context.Context, query *models.SearchOrgUsersQuery) error
- func (ss *SQLStore) SearchOrgs(ctx context.Context, query *models.SearchOrgsQuery) error
- func (ss *SQLStore) SearchPlaylists(ctx context.Context, query *models.GetPlaylistsQuery) error
- func (ss *SQLStore) SearchTeams(ctx context.Context, query *models.SearchTeamsQuery) error
- func (ss *SQLStore) SearchUsers(ctx context.Context, query *models.SearchUsersQuery) error
- func (ss *SQLStore) SetAlertNotificationStateToCompleteCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToCompleteCommand) error
- func (ss *SQLStore) SetAlertNotificationStateToPendingCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToPendingCommand) error
- func (ss *SQLStore) SetAlertState(ctx context.Context, cmd *models.SetAlertStateCommand) error
- func (ss *SQLStore) SetUserHelpFlag(ctx context.Context, cmd *models.SetUserHelpFlagCommand) error
- func (ss *SQLStore) SetUsingOrg(ctx context.Context, cmd *models.SetUsingOrgCommand) error
- func (ss *SQLStore) StarDashboard(ctx context.Context, cmd *models.StarDashboardCommand) error
- func (ss *SQLStore) Sync() error
- func (ss *SQLStore) UnstarDashboard(ctx context.Context, cmd *models.UnstarDashboardCommand) error
- func (ss *SQLStore) UpdateAlertNotification(ctx context.Context, cmd *models.UpdateAlertNotificationCommand) error
- func (ss *SQLStore) UpdateAlertNotificationWithUid(ctx context.Context, cmd *models.UpdateAlertNotificationWithUidCommand) error
- func (ss *SQLStore) UpdateDataSource(ctx context.Context, cmd *models.UpdateDataSourceCommand) error
- func (ss *SQLStore) UpdateOrg(ctx context.Context, cmd *models.UpdateOrgCommand) error
- func (ss *SQLStore) UpdateOrgAddress(ctx context.Context, cmd *models.UpdateOrgAddressCommand) error
- func (ss *SQLStore) UpdateOrgQuota(ctx context.Context, cmd *models.UpdateOrgQuotaCmd) error
- func (ss *SQLStore) UpdateOrgUser(ctx context.Context, cmd *models.UpdateOrgUserCommand) error
- func (ss *SQLStore) UpdatePlaylist(ctx context.Context, cmd *models.UpdatePlaylistCommand) error
- func (ss *SQLStore) UpdatePluginSetting(ctx context.Context, cmd *models.UpdatePluginSettingCmd) error
- func (ss *SQLStore) UpdatePluginSettingVersion(ctx context.Context, cmd *models.UpdatePluginSettingVersionCmd) error
- func (ss *SQLStore) UpdateTeam(ctx context.Context, cmd *models.UpdateTeamCommand) error
- func (ss *SQLStore) UpdateTeamMember(ctx context.Context, cmd *models.UpdateTeamMemberCommand) error
- func (ss *SQLStore) UpdateTempUserStatus(ctx context.Context, cmd *models.UpdateTempUserStatusCommand) error
- func (ss *SQLStore) UpdateTempUserWithEmailSent(ctx context.Context, cmd *models.UpdateTempUserWithEmailSentCommand) error
- func (ss *SQLStore) UpdateThumbnailState(ctx context.Context, cmd *models.UpdateThumbnailStateCommand) error
- func (ss *SQLStore) UpdateUser(ctx context.Context, cmd *models.UpdateUserCommand) error
- func (ss *SQLStore) UpdateUserLastSeenAt(ctx context.Context, cmd *models.UpdateUserLastSeenAtCommand) error
- func (ss *SQLStore) UpdateUserPermissions(userID int64, isAdmin bool) error
- func (ss *SQLStore) UpdateUserQuota(ctx context.Context, cmd *models.UpdateUserQuotaCmd) error
- func (ss *SQLStore) WithDbSession(ctx context.Context, callback DBTransactionFunc) error
- func (ss *SQLStore) WithTransactionalDbSession(ctx context.Context, callback DBTransactionFunc) error
- type Store
- type TeamStore
- 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 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.
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdateTeamMemberHook ¶
func AddOrUpdateTeamMemberHook(sess *DBSession, userID, orgID, teamID int64, isExternal bool, permission models.PermissionType) error
AddOrUpdateTeamMemberHook is called from team resource permission service it adds user to a team or updates user permissions in a team within the given transaction session
func EnsureTagsExist ¶
Will insert if needed any new key/value pars and return ids
func GetAlertsByDashboardId2 ¶
func IsAdminOfTeams ¶
func IsAdminOfTeams(ctx context.Context, query *models.IsAdminOfTeamsQuery) error
func IsTestDBMSSQL ¶
func IsTestDBMSSQL() bool
func IsTestDbMySQL ¶
func IsTestDbMySQL() bool
func IsTestDbPostgres ¶
func IsTestDbPostgres() bool
func RemoveTeamMemberHook ¶
func RemoveTeamMemberHook(sess *DBSession, cmd *models.RemoveTeamMemberCommand) error
RemoveTeamMemberHook is called from team resource permission service it removes a member from a team within the given transaction session
func UserDeletions ¶
func UserDeletions() []string
Types ¶
type AlertNotificationStore ¶
type AlertNotificationStore interface { DeleteAlertNotification(ctx context.Context, cmd *models.DeleteAlertNotificationCommand) error DeleteAlertNotificationWithUid(ctx context.Context, cmd *models.DeleteAlertNotificationWithUidCommand) error GetAlertNotifications(ctx context.Context, query *models.GetAlertNotificationsQuery) error GetAlertNotificationUidWithId(ctx context.Context, query *models.GetAlertNotificationUidQuery) error GetAlertNotificationsWithUid(ctx context.Context, query *models.GetAlertNotificationsWithUidQuery) error GetAllAlertNotifications(ctx context.Context, query *models.GetAllAlertNotificationsQuery) error GetAlertNotificationsWithUidToSend(ctx context.Context, query *models.GetAlertNotificationsWithUidToSendQuery) error CreateAlertNotificationCommand(ctx context.Context, cmd *models.CreateAlertNotificationCommand) error UpdateAlertNotification(ctx context.Context, cmd *models.UpdateAlertNotificationCommand) error UpdateAlertNotificationWithUid(ctx context.Context, cmd *models.UpdateAlertNotificationWithUidCommand) error SetAlertNotificationStateToCompleteCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToCompleteCommand) error SetAlertNotificationStateToPendingCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToPendingCommand) error GetOrCreateAlertNotificationState(ctx context.Context, cmd *models.GetOrCreateNotificationStateQuery) error }
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 DBTransactionFunc ¶
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 MigrationLockAttemptTimeout int }
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 FeatureFlags []string }
InitTestDBOpt contains options for InitTestDB.
type SQLAnnotationRepo ¶
type SQLAnnotationRepo struct {
// contains filtered or unexported fields
}
func NewSQLAnnotationRepo ¶
func NewSQLAnnotationRepo(sql *SQLStore) SQLAnnotationRepo
func (*SQLAnnotationRepo) Delete ¶
func (r *SQLAnnotationRepo) Delete(ctx context.Context, params *annotations.DeleteParams) error
func (*SQLAnnotationRepo) Find ¶
func (r *SQLAnnotationRepo) Find(ctx context.Context, query *annotations.ItemQuery) ([]*annotations.ItemDTO, error)
func (*SQLAnnotationRepo) FindTags ¶
func (r *SQLAnnotationRepo) FindTags(ctx context.Context, query *annotations.TagsQuery) (annotations.FindTagsResult, error)
func (*SQLAnnotationRepo) Save ¶
func (r *SQLAnnotationRepo) Save(item *annotations.Item) error
func (*SQLAnnotationRepo) Update ¶
func (r *SQLAnnotationRepo) Update(ctx context.Context, 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 CacheService *localcache.CacheService Dialect migrator.Dialect // contains filtered or unexported fields }
func InitTestDB ¶
func InitTestDB(t ITestDB, opts ...InitTestDBOpt) *SQLStore
InitTestDB initializes the test DB.
func InitTestDBWithMigration ¶
func InitTestDBWithMigration(t ITestDB, migration registry.DatabaseMigrator, opts ...InitTestDBOpt) *SQLStore
InitTestDBWithMigration initializes the test DB given custom migrations.
func ProvideService ¶
func ProvideService(cfg *setting.Cfg, cacheService *localcache.CacheService, migrations registry.DatabaseMigrator, tracer tracing.Tracer) (*SQLStore, error)
func ProvideServiceForTests ¶
func ProvideServiceForTests(migrations registry.DatabaseMigrator) (*SQLStore, error)
func (*SQLStore) AddDataSource ¶
func (*SQLStore) AddOrgUser ¶
func (*SQLStore) AddTeamMember ¶
func (ss *SQLStore) AddTeamMember(userID, orgID, teamID int64, isExternal bool, permission models.PermissionType) error
AddTeamMember adds a user to a team
func (*SQLStore) BatchDisableUsers ¶
func (*SQLStore) ChangeUserPassword ¶
func (*SQLStore) CreateAlertNotificationCommand ¶
func (*SQLStore) CreateDashboardSnapshot ¶
func (*SQLStore) CreateLoginAttempt ¶
func (*SQLStore) CreateOrgWithMember ¶
CreateOrgWithMember creates an organization with a certain name and a certain user as member.
func (*SQLStore) CreatePlaylist ¶
func (*SQLStore) CreateTeam ¶
func (*SQLStore) CreateTempUser ¶
func (*SQLStore) CreateUser ¶
func (*SQLStore) DeleteAlertNotification ¶
func (*SQLStore) DeleteAlertNotificationWithUid ¶
func (*SQLStore) DeleteApiKey ¶
func (*SQLStore) DeleteDashboardSnapshot ¶
func (*SQLStore) DeleteDataSource ¶
func (ss *SQLStore) DeleteDataSource(ctx context.Context, 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. It also removes permissions related to the datasource.
func (*SQLStore) DeleteExpiredSnapshots ¶
func (ss *SQLStore) DeleteExpiredSnapshots(ctx context.Context, 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 (*SQLStore) DeleteExpiredVersions ¶
func (*SQLStore) DeleteOldLoginAttempts ¶
func (*SQLStore) DeletePlaylist ¶
func (*SQLStore) DeleteTeam ¶
DeleteTeam will delete a team, its member and any permissions connected to the team
func (*SQLStore) DeleteUser ¶
func (*SQLStore) DisableUser ¶
func (*SQLStore) ExpireOldUserInvites ¶
func (*SQLStore) FindDashboards ¶
func (ss *SQLStore) FindDashboards(ctx context.Context, query *models.FindPersistedDashboardsQuery) ([]DashboardSearchProjection, error)
func (*SQLStore) FindDashboardsWithStaleThumbnails ¶
func (ss *SQLStore) FindDashboardsWithStaleThumbnails(ctx context.Context, cmd *models.FindDashboardsWithStaleThumbnailsCommand) ([]*models.DashboardWithStaleThumbnail, error)
func (*SQLStore) FindThumbnailCount ¶
func (*SQLStore) GetAPIKeys ¶
GetAPIKeys queries the database based on input on GetApiKeysQuery
func (*SQLStore) GetAdminStats ¶
func (*SQLStore) GetAlertById ¶
func (*SQLStore) GetAlertNotificationUidWithId ¶
func (*SQLStore) GetAlertNotifications ¶
func (*SQLStore) GetAlertNotificationsWithUid ¶
func (*SQLStore) GetAlertNotificationsWithUidToSend ¶
func (*SQLStore) GetAlertNotifiersUsageStats ¶
func (*SQLStore) GetAlertStatesForDashboard ¶
func (*SQLStore) GetAllAlertNotifications ¶
func (*SQLStore) GetAllAlertQueryHandler ¶
func (*SQLStore) GetAllOrgsAPIKeys ¶
GetAllOrgsAPIKeys queries the database for valid non SA APIKeys across all orgs
func (*SQLStore) GetApiKeyById ¶
func (*SQLStore) GetApiKeyByName ¶
func (*SQLStore) GetDBHealthQuery ¶
GetDBHealthQuery executes a query to check the availability of the database.
func (*SQLStore) GetDashboard ¶
func (*SQLStore) GetDashboardAclInfoList ¶
func (ss *SQLStore) GetDashboardAclInfoList(ctx context.Context, 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 (*SQLStore) GetDashboardPermissionsForUser ¶
func (ss *SQLStore) GetDashboardPermissionsForUser(ctx context.Context, 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 (*SQLStore) GetDashboardSlugById ¶
func (*SQLStore) GetDashboardSnapshot ¶
func (ss *SQLStore) GetDashboardSnapshot(query *models.GetDashboardSnapshotQuery) error
func (*SQLStore) GetDashboardTags ¶
func (*SQLStore) GetDashboardUIDById ¶
func (*SQLStore) GetDashboardVersion ¶
func (ss *SQLStore) GetDashboardVersion(ctx context.Context, query *models.GetDashboardVersionQuery) error
GetDashboardVersion gets the dashboard version for the given dashboard ID and version number.
func (*SQLStore) GetDashboardVersions ¶
func (ss *SQLStore) GetDashboardVersions(ctx context.Context, query *models.GetDashboardVersionsQuery) error
GetDashboardVersions gets all dashboard versions for the given dashboard ID.
func (*SQLStore) GetDashboards ¶
func (*SQLStore) GetDataSource ¶
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 (*SQLStore) GetDataSourceAccessStats ¶
func (*SQLStore) GetDataSourceStats ¶
func (*SQLStore) GetDataSources ¶
func (*SQLStore) GetDataSourcesByType ¶
func (ss *SQLStore) GetDataSourcesByType(ctx context.Context, query *models.GetDataSourcesByTypeQuery) error
GetDataSourcesByType returns all datasources for a given type or an error if the specified type is an empty string
func (*SQLStore) GetDefaultDataSource ¶
func (ss *SQLStore) GetDefaultDataSource(ctx context.Context, query *models.GetDefaultDataSourceQuery) error
GetDefaultDataSource is used to get the default datasource of organization
func (*SQLStore) GetDialect ¶
GetDialect return the dialect
func (*SQLStore) GetGlobalQuotaByTarget ¶
func (*SQLStore) GetOrCreateAlertNotificationState ¶
func (*SQLStore) GetOrgById ¶
func (*SQLStore) GetOrgByName ¶
GetOrgByName gets an organization by name.
func (*SQLStore) GetOrgByNameHandler ¶
func (*SQLStore) GetOrgQuotaByTarget ¶
func (*SQLStore) GetOrgQuotas ¶
func (*SQLStore) GetOrgUsers ¶
func (*SQLStore) GetPlaylist ¶
func (*SQLStore) GetPlaylistItem ¶
func (*SQLStore) GetPluginSettingById ¶
func (*SQLStore) GetPluginSettings ¶
func (*SQLStore) GetPreferences ¶
func (*SQLStore) GetPreferencesWithDefaults ¶
func (*SQLStore) GetSignedInUser ¶
func (*SQLStore) GetSignedInUserWithCacheCtx ¶
func (*SQLStore) GetSystemStats ¶
func (*SQLStore) GetSystemUserCountStats ¶
func (*SQLStore) GetTeamById ¶
func (*SQLStore) GetTeamMembers ¶
GetTeamMembers return a list of members for the specified team filtered based on the user's permissions
func (*SQLStore) GetTeamsByUser ¶
GetTeamsByUser is used by the Guardian when checking a users' permissions
func (*SQLStore) GetTempUserByCode ¶
func (*SQLStore) GetTempUsersQuery ¶
func (*SQLStore) GetThumbnail ¶
func (ss *SQLStore) GetThumbnail(ctx context.Context, query *models.GetDashboardThumbnailCommand) (*models.DashboardThumbnail, error)
func (*SQLStore) GetUserByEmail ¶
func (*SQLStore) GetUserById ¶
func (*SQLStore) GetUserByLogin ¶
func (*SQLStore) GetUserLoginAttemptCount ¶
func (*SQLStore) GetUserOrgList ¶
func (*SQLStore) GetUserProfile ¶
func (*SQLStore) GetUserQuotaByTarget ¶
func (*SQLStore) GetUserQuotas ¶
func (*SQLStore) GetUserStars ¶
func (*SQLStore) GetUserTeamMemberships ¶
func (ss *SQLStore) GetUserTeamMemberships(ctx context.Context, orgID, userID int64, external bool) ([]*models.TeamMemberDTO, error)
GetUserTeamMemberships return a list of memberships to teams granted to a user If external is specified, only memberships provided by an external auth provider will be listed This function doesn't perform any accesscontrol filtering.
func (*SQLStore) HandleAlertsQuery ¶
func (*SQLStore) HasAdminPermissionInDashboardsOrFolders ¶
func (*SQLStore) HasEditPermissionInFolders ¶
func (ss *SQLStore) HasEditPermissionInFolders(ctx context.Context, query *models.HasEditPermissionInFoldersQuery) error
HasEditPermissionInFolders validates that an user have access to a certain folder
func (*SQLStore) InTransaction ¶
func (*SQLStore) IsStarredByUserCtx ¶
func (*SQLStore) IsTeamMember ¶
func (*SQLStore) Migrate ¶
Migrate performs database migrations. Has to be done in a second phase (after initialization), since other services can register migrations during the initialization phase.
func (*SQLStore) NewSession ¶
NewSession returns a new DBSession
func (*SQLStore) PatchPreferences ¶
func (*SQLStore) PauseAlert ¶
func (*SQLStore) PauseAllAlerts ¶
func (*SQLStore) RemoveOrgUser ¶
func (*SQLStore) RemoveTeamMember ¶
func (ss *SQLStore) RemoveTeamMember(ctx context.Context, cmd *models.RemoveTeamMemberCommand) error
RemoveTeamMember removes a member from a team
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) SaveAlerts ¶
func (*SQLStore) SavePreferences ¶
func (*SQLStore) SaveThumbnail ¶
func (ss *SQLStore) SaveThumbnail(ctx context.Context, cmd *models.SaveDashboardThumbnailCommand) (*models.DashboardThumbnail, error)
func (*SQLStore) SearchDashboardSnapshots ¶
func (ss *SQLStore) 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 (*SQLStore) SearchDashboards ¶
func (*SQLStore) SearchOrgUsers ¶
func (*SQLStore) SearchOrgs ¶
func (*SQLStore) SearchPlaylists ¶
func (*SQLStore) SearchTeams ¶
func (*SQLStore) SearchUsers ¶
func (*SQLStore) SetAlertNotificationStateToCompleteCommand ¶
func (*SQLStore) SetAlertNotificationStateToPendingCommand ¶
func (*SQLStore) SetAlertState ¶
func (*SQLStore) SetUserHelpFlag ¶
func (*SQLStore) SetUsingOrg ¶
func (*SQLStore) StarDashboard ¶
func (*SQLStore) UnstarDashboard ¶
func (*SQLStore) UpdateAlertNotification ¶
func (*SQLStore) UpdateAlertNotificationWithUid ¶
func (*SQLStore) UpdateDataSource ¶
func (*SQLStore) UpdateOrgAddress ¶
func (*SQLStore) UpdateOrgQuota ¶
func (*SQLStore) UpdateOrgUser ¶
func (*SQLStore) UpdatePlaylist ¶
func (*SQLStore) UpdatePluginSetting ¶
func (*SQLStore) UpdatePluginSettingVersion ¶
func (*SQLStore) UpdateTeam ¶
func (*SQLStore) UpdateTeamMember ¶
func (ss *SQLStore) UpdateTeamMember(ctx context.Context, cmd *models.UpdateTeamMemberCommand) error
UpdateTeamMember updates a team member
func (*SQLStore) UpdateTempUserStatus ¶
func (*SQLStore) UpdateTempUserWithEmailSent ¶
func (*SQLStore) UpdateThumbnailState ¶
func (*SQLStore) UpdateUser ¶
func (*SQLStore) UpdateUserLastSeenAt ¶
func (*SQLStore) UpdateUserPermissions ¶
UpdateUserPermissions sets the user Server Admin flag
func (*SQLStore) UpdateUserQuota ¶
func (*SQLStore) WithDbSession ¶
func (ss *SQLStore) WithDbSession(ctx context.Context, callback DBTransactionFunc) error
WithDbSession calls the callback with a session.
func (*SQLStore) WithTransactionalDbSession ¶
func (ss *SQLStore) WithTransactionalDbSession(ctx context.Context, callback DBTransactionFunc) error
WithTransactionalDbSession calls the callback with a session within a transaction.
type Store ¶
type Store interface { GetAdminStats(ctx context.Context, query *models.GetAdminStatsQuery) error GetAlertNotifiersUsageStats(ctx context.Context, query *models.GetAlertNotifierUsageStatsQuery) error GetDataSourceStats(ctx context.Context, query *models.GetDataSourceStatsQuery) error GetDataSourceAccessStats(ctx context.Context, query *models.GetDataSourceAccessStatsQuery) error GetDialect() migrator.Dialect GetSystemStats(ctx context.Context, query *models.GetSystemStatsQuery) error DeleteExpiredSnapshots(ctx context.Context, cmd *models.DeleteExpiredSnapshotsCommand) error CreateDashboardSnapshot(ctx context.Context, cmd *models.CreateDashboardSnapshotCommand) error DeleteDashboardSnapshot(ctx context.Context, cmd *models.DeleteDashboardSnapshotCommand) error GetDashboardSnapshot(query *models.GetDashboardSnapshotQuery) error HasEditPermissionInFolders(ctx context.Context, query *models.HasEditPermissionInFoldersQuery) error SearchDashboardSnapshots(query *models.GetDashboardSnapshotsQuery) error GetOrgByName(name string) (*models.Org, error) CreateOrgWithMember(name string, userID int64) (models.Org, error) UpdateOrg(ctx context.Context, cmd *models.UpdateOrgCommand) error UpdateOrgAddress(ctx context.Context, cmd *models.UpdateOrgAddressCommand) error DeleteOrg(ctx context.Context, cmd *models.DeleteOrgCommand) error GetOrgById(context.Context, *models.GetOrgByIdQuery) error GetOrgByNameHandler(ctx context.Context, query *models.GetOrgByNameQuery) error CreateLoginAttempt(ctx context.Context, cmd *models.CreateLoginAttemptCommand) error GetUserLoginAttemptCount(ctx context.Context, query *models.GetUserLoginAttemptCountQuery) error DeleteOldLoginAttempts(ctx context.Context, cmd *models.DeleteOldLoginAttemptsCommand) error CreateUser(ctx context.Context, cmd models.CreateUserCommand) (*models.User, error) GetUserById(ctx context.Context, query *models.GetUserByIdQuery) error GetUserByLogin(ctx context.Context, query *models.GetUserByLoginQuery) error GetUserByEmail(ctx context.Context, query *models.GetUserByEmailQuery) error UpdateUser(ctx context.Context, cmd *models.UpdateUserCommand) error ChangeUserPassword(ctx context.Context, cmd *models.ChangeUserPasswordCommand) error UpdateUserLastSeenAt(ctx context.Context, cmd *models.UpdateUserLastSeenAtCommand) error SetUsingOrg(ctx context.Context, cmd *models.SetUsingOrgCommand) error GetUserProfile(ctx context.Context, query *models.GetUserProfileQuery) error GetUserOrgList(ctx context.Context, query *models.GetUserOrgListQuery) error GetSignedInUserWithCacheCtx(ctx context.Context, query *models.GetSignedInUserQuery) error GetSignedInUser(ctx context.Context, query *models.GetSignedInUserQuery) error SearchUsers(ctx context.Context, query *models.SearchUsersQuery) error DisableUser(ctx context.Context, cmd *models.DisableUserCommand) error BatchDisableUsers(ctx context.Context, cmd *models.BatchDisableUsersCommand) error DeleteUser(ctx context.Context, cmd *models.DeleteUserCommand) error UpdateUserPermissions(userID int64, isAdmin bool) error SetUserHelpFlag(ctx context.Context, cmd *models.SetUserHelpFlagCommand) error CreateTeam(name, email string, orgID int64) (models.Team, error) UpdateTeam(ctx context.Context, cmd *models.UpdateTeamCommand) error DeleteTeam(ctx context.Context, cmd *models.DeleteTeamCommand) error SearchTeams(ctx context.Context, query *models.SearchTeamsQuery) error GetTeamById(ctx context.Context, query *models.GetTeamByIdQuery) error GetTeamsByUser(ctx context.Context, query *models.GetTeamsByUserQuery) error AddTeamMember(userID, orgID, teamID int64, isExternal bool, permission models.PermissionType) error UpdateTeamMember(ctx context.Context, cmd *models.UpdateTeamMemberCommand) error IsTeamMember(orgId int64, teamId int64, userId int64) (bool, error) RemoveTeamMember(ctx context.Context, cmd *models.RemoveTeamMemberCommand) error GetUserTeamMemberships(ctx context.Context, orgID, userID int64, external bool) ([]*models.TeamMemberDTO, error) GetTeamMembers(ctx context.Context, query *models.GetTeamMembersQuery) error NewSession(ctx context.Context) *DBSession WithDbSession(ctx context.Context, callback DBTransactionFunc) error GetPreferencesWithDefaults(ctx context.Context, query *models.GetPreferencesWithDefaultsQuery) error GetPreferences(ctx context.Context, query *models.GetPreferencesQuery) error SavePreferences(ctx context.Context, cmd *models.SavePreferencesCommand) error PatchPreferences(ctx context.Context, cmd *models.PatchPreferencesCommand) error GetPluginSettings(ctx context.Context, orgID int64) ([]*models.PluginSetting, error) GetPluginSettingById(ctx context.Context, query *models.GetPluginSettingByIdQuery) error UpdatePluginSetting(ctx context.Context, cmd *models.UpdatePluginSettingCmd) error UpdatePluginSettingVersion(ctx context.Context, cmd *models.UpdatePluginSettingVersionCmd) error IsStarredByUserCtx(ctx context.Context, query *models.IsStarredByUserQuery) error StarDashboard(ctx context.Context, cmd *models.StarDashboardCommand) error UnstarDashboard(ctx context.Context, cmd *models.UnstarDashboardCommand) error GetUserStars(ctx context.Context, query *models.GetUserStarsQuery) error GetOrgQuotaByTarget(ctx context.Context, query *models.GetOrgQuotaByTargetQuery) error GetOrgQuotas(ctx context.Context, query *models.GetOrgQuotasQuery) error UpdateOrgQuota(ctx context.Context, cmd *models.UpdateOrgQuotaCmd) error GetUserQuotaByTarget(ctx context.Context, query *models.GetUserQuotaByTargetQuery) error GetUserQuotas(ctx context.Context, query *models.GetUserQuotasQuery) error UpdateUserQuota(ctx context.Context, cmd *models.UpdateUserQuotaCmd) error GetGlobalQuotaByTarget(ctx context.Context, query *models.GetGlobalQuotaByTargetQuery) error WithTransactionalDbSession(ctx context.Context, callback DBTransactionFunc) error InTransaction(ctx context.Context, fn func(ctx context.Context) error) error GetDashboardVersion(ctx context.Context, query *models.GetDashboardVersionQuery) error GetDashboardVersions(ctx context.Context, query *models.GetDashboardVersionsQuery) error DeleteExpiredVersions(ctx context.Context, cmd *models.DeleteExpiredVersionsCommand) error GetDashboardAclInfoList(ctx context.Context, query *models.GetDashboardAclInfoListQuery) error CreatePlaylist(ctx context.Context, cmd *models.CreatePlaylistCommand) error UpdatePlaylist(ctx context.Context, cmd *models.UpdatePlaylistCommand) error GetPlaylist(ctx context.Context, query *models.GetPlaylistByIdQuery) error DeletePlaylist(ctx context.Context, cmd *models.DeletePlaylistCommand) error SearchPlaylists(ctx context.Context, query *models.GetPlaylistsQuery) error GetPlaylistItem(ctx context.Context, query *models.GetPlaylistItemsByIdQuery) error GetAlertById(ctx context.Context, query *models.GetAlertByIdQuery) error GetAllAlertQueryHandler(ctx context.Context, query *models.GetAllAlertsQuery) error HandleAlertsQuery(ctx context.Context, query *models.GetAlertsQuery) error SetAlertState(ctx context.Context, cmd *models.SetAlertStateCommand) error PauseAlert(ctx context.Context, cmd *models.PauseAlertCommand) error PauseAllAlerts(ctx context.Context, cmd *models.PauseAllAlertCommand) error GetAlertStatesForDashboard(ctx context.Context, query *models.GetAlertStatesForDashboardQuery) error AddOrgUser(ctx context.Context, cmd *models.AddOrgUserCommand) error UpdateOrgUser(ctx context.Context, cmd *models.UpdateOrgUserCommand) error GetOrgUsers(ctx context.Context, query *models.GetOrgUsersQuery) error SearchOrgUsers(ctx context.Context, query *models.SearchOrgUsersQuery) error RemoveOrgUser(ctx context.Context, cmd *models.RemoveOrgUserCommand) error GetDashboard(ctx context.Context, query *models.GetDashboardQuery) error GetDashboardTags(ctx context.Context, query *models.GetDashboardTagsQuery) error SearchDashboards(ctx context.Context, query *models.FindPersistedDashboardsQuery) error GetDashboards(ctx context.Context, query *models.GetDashboardsQuery) error GetDashboardUIDById(ctx context.Context, query *models.GetDashboardRefByIdQuery) error GetDataSource(ctx context.Context, query *models.GetDataSourceQuery) error GetDataSources(ctx context.Context, query *models.GetDataSourcesQuery) error GetDataSourcesByType(ctx context.Context, query *models.GetDataSourcesByTypeQuery) error GetDefaultDataSource(ctx context.Context, query *models.GetDefaultDataSourceQuery) error DeleteDataSource(ctx context.Context, cmd *models.DeleteDataSourceCommand) error AddDataSource(ctx context.Context, cmd *models.AddDataSourceCommand) error UpdateDataSource(ctx context.Context, cmd *models.UpdateDataSourceCommand) error Migrate(bool) error Sync() error Reset() error Quote(value string) string DeleteAlertNotification(ctx context.Context, cmd *models.DeleteAlertNotificationCommand) error DeleteAlertNotificationWithUid(ctx context.Context, cmd *models.DeleteAlertNotificationWithUidCommand) error GetAlertNotifications(ctx context.Context, query *models.GetAlertNotificationsQuery) error GetAlertNotificationUidWithId(ctx context.Context, query *models.GetAlertNotificationUidQuery) error GetAlertNotificationsWithUid(ctx context.Context, query *models.GetAlertNotificationsWithUidQuery) error GetAllAlertNotifications(ctx context.Context, query *models.GetAllAlertNotificationsQuery) error GetAlertNotificationsWithUidToSend(ctx context.Context, query *models.GetAlertNotificationsWithUidToSendQuery) error CreateAlertNotificationCommand(ctx context.Context, cmd *models.CreateAlertNotificationCommand) error UpdateAlertNotification(ctx context.Context, cmd *models.UpdateAlertNotificationCommand) error UpdateAlertNotificationWithUid(ctx context.Context, cmd *models.UpdateAlertNotificationWithUidCommand) error SetAlertNotificationStateToCompleteCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToCompleteCommand) error SetAlertNotificationStateToPendingCommand(ctx context.Context, cmd *models.SetAlertNotificationStateToPendingCommand) error GetOrCreateAlertNotificationState(ctx context.Context, cmd *models.GetOrCreateNotificationStateQuery) error GetAPIKeys(ctx context.Context, query *models.GetApiKeysQuery) error GetAllOrgsAPIKeys(ctx context.Context) []*models.ApiKey DeleteApiKey(ctx context.Context, cmd *models.DeleteApiKeyCommand) error AddAPIKey(ctx context.Context, cmd *models.AddApiKeyCommand) error GetApiKeyById(ctx context.Context, query *models.GetApiKeyByIdQuery) error GetApiKeyByName(ctx context.Context, query *models.GetApiKeyByNameQuery) error UpdateTempUserStatus(ctx context.Context, cmd *models.UpdateTempUserStatusCommand) error CreateTempUser(ctx context.Context, cmd *models.CreateTempUserCommand) error UpdateTempUserWithEmailSent(ctx context.Context, cmd *models.UpdateTempUserWithEmailSentCommand) error GetTempUsersQuery(ctx context.Context, query *models.GetTempUsersQuery) error GetTempUserByCode(ctx context.Context, query *models.GetTempUserByCodeQuery) error ExpireOldUserInvites(ctx context.Context, cmd *models.ExpireTempUsersCommand) error GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error SearchOrgs(ctx context.Context, query *models.SearchOrgsQuery) error HasAdminPermissionInDashboardsOrFolders(ctx context.Context, query *models.HasAdminPermissionInDashboardsOrFoldersQuery) error GetDashboardPermissionsForUser(ctx context.Context, query *models.GetDashboardPermissionsForUserQuery) error GetDashboardSlugById(ctx context.Context, query *models.GetDashboardSlugByIdQuery) error }
type TeamStore ¶
type TeamStore interface { UpdateTeam(ctx context.Context, cmd *models.UpdateTeamCommand) error DeleteTeam(ctx context.Context, cmd *models.DeleteTeamCommand) error SearchTeams(ctx context.Context, query *models.SearchTeamsQuery) error GetTeamById(ctx context.Context, query *models.GetTeamByIdQuery) error UpdateTeamMember(ctx context.Context, cmd *models.UpdateTeamMemberCommand) error RemoveTeamMember(ctx context.Context, cmd *models.RemoveTeamMemberCommand) error GetTeamMembers(ctx context.Context, cmd *models.GetTeamMembersQuery) error GetUserTeamMemberships(ctx context.Context, orgID, userID int64, external bool) ([]*models.TeamMemberDTO, error) AddOrUpdateTeamMember(userID, orgID, teamID int64, isExternal bool, permission models.PermissionType) error }
type XormLogger ¶
type XormLogger struct {
// contains filtered or unexported fields
}
func NewXormLogger ¶
func NewXormLogger(level glog.Lvl, grafanaLog 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_thumbs.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
- sqlbuilder.go
- sqlstore.go
- star.go
- stats.go
- store.go
- tables.go
- tags.go
- team.go
- temp_user.go
- tls_mysql.go
- transactions.go
- user.go
Directories
¶
Path | Synopsis |
---|---|
Package searchstore converts search queries to SQL.
|
Package searchstore converts search queries to SQL. |