Documentation ¶
Index ¶
- type AliasRepository
- func (r *AliasRepository) Delete(id uint) error
- func (r *AliasRepository) DeleteBatch(ids []uint) error
- func (r *AliasRepository) GetAll() ([]*models.Alias, error)
- func (r *AliasRepository) GetByUser(userId string) ([]*models.Alias, error)
- func (r *AliasRepository) GetByUserAndKey(userId, key string) ([]*models.Alias, error)
- func (r *AliasRepository) GetByUserAndKeyAndType(userId, key string, summaryType uint8) ([]*models.Alias, error)
- func (r *AliasRepository) GetByUserAndTypeAndValue(userId string, summaryType uint8, value string) (*models.Alias, error)
- func (r *AliasRepository) Insert(alias *models.Alias) (*models.Alias, error)
- type DiagnosticsRepository
- type HeartbeatRepository
- func (r *HeartbeatRepository) Count(approximate bool) (count int64, err error)
- func (r *HeartbeatRepository) CountByUser(user *models.User) (int64, error)
- func (r *HeartbeatRepository) CountByUsers(users []*models.User) ([]*models.CountByUser, error)
- func (r *HeartbeatRepository) DeleteBefore(t time.Time) error
- func (r *HeartbeatRepository) DeleteByUser(user *models.User) error
- func (r *HeartbeatRepository) DeleteByUserBefore(user *models.User, t time.Time) error
- func (r *HeartbeatRepository) GetAll() ([]*models.Heartbeat, error)
- func (r *HeartbeatRepository) GetAllWithin(from, to time.Time, user *models.User) ([]*models.Heartbeat, error)
- func (r *HeartbeatRepository) GetAllWithinByFilters(from, to time.Time, user *models.User, filterMap map[string][]string) ([]*models.Heartbeat, error)
- func (r *HeartbeatRepository) GetEntitySetByUser(entityType uint8, userId string) ([]string, error)
- func (r *HeartbeatRepository) GetFirstByUsers() ([]*models.TimeByUser, error)
- func (r *HeartbeatRepository) GetLastByUsers() ([]*models.TimeByUser, error)
- func (r *HeartbeatRepository) GetLatestByFilters(user *models.User, filterMap map[string][]string) (*models.Heartbeat, error)
- func (r *HeartbeatRepository) GetLatestByOriginAndUser(origin string, user *models.User) (*models.Heartbeat, error)
- func (r *HeartbeatRepository) GetLatestByUser(user *models.User) (*models.Heartbeat, error)
- func (r *HeartbeatRepository) GetUserProjectStats(user *models.User, from, to time.Time, limit, offset int) ([]*models.ProjectStats, error)
- func (r *HeartbeatRepository) InsertBatch(heartbeats []*models.Heartbeat) error
- type IAliasRepository
- type IDiagnosticsRepository
- type IHeartbeatRepository
- type IKeyValueRepository
- type ILanguageMappingRepository
- type ILeaderboardRepository
- type IProjectLabelRepository
- type ISummaryRepository
- type IUserRepository
- type KeyValueRepository
- func (r *KeyValueRepository) DeleteString(key string) error
- func (r *KeyValueRepository) GetAll() ([]*models.KeyStringValue, error)
- func (r *KeyValueRepository) GetString(key string) (*models.KeyStringValue, error)
- func (r *KeyValueRepository) PutString(kv *models.KeyStringValue) error
- func (r *KeyValueRepository) Search(like string) ([]*models.KeyStringValue, error)
- type LanguageMappingRepository
- func (r *LanguageMappingRepository) Delete(id uint) error
- func (r *LanguageMappingRepository) GetAll() ([]*models.LanguageMapping, error)
- func (r *LanguageMappingRepository) GetById(id uint) (*models.LanguageMapping, error)
- func (r *LanguageMappingRepository) GetByUser(userId string) ([]*models.LanguageMapping, error)
- func (r *LanguageMappingRepository) Insert(mapping *models.LanguageMapping) (*models.LanguageMapping, error)
- type LeaderboardRepository
- func (r *LeaderboardRepository) CountAllByUser(userId string) (int64, error)
- func (r *LeaderboardRepository) CountUsers(excludeZero bool) (int64, error)
- func (r *LeaderboardRepository) DeleteByUser(userId string) error
- func (r *LeaderboardRepository) DeleteByUserAndInterval(userId string, key *models.IntervalKey) error
- func (r *LeaderboardRepository) GetAggregatedByUserAndInterval(userId string, key *models.IntervalKey, by *uint8, limit, skip int) ([]*models.LeaderboardItemRanked, error)
- func (r *LeaderboardRepository) GetAllAggregatedByInterval(key *models.IntervalKey, by *uint8, limit, skip int) ([]*models.LeaderboardItemRanked, error)
- func (r *LeaderboardRepository) InsertBatch(items []*models.LeaderboardItem) error
- type MetricsRepository
- type ProjectLabelRepository
- func (r *ProjectLabelRepository) Delete(id uint) error
- func (r *ProjectLabelRepository) GetAll() ([]*models.ProjectLabel, error)
- func (r *ProjectLabelRepository) GetById(id uint) (*models.ProjectLabel, error)
- func (r *ProjectLabelRepository) GetByUser(userId string) ([]*models.ProjectLabel, error)
- func (r *ProjectLabelRepository) Insert(label *models.ProjectLabel) (*models.ProjectLabel, error)
- type SummaryRepository
- func (r *SummaryRepository) DeleteByUser(userId string) error
- func (r *SummaryRepository) DeleteByUserBefore(userId string, t time.Time) error
- func (r *SummaryRepository) GetAll() ([]*models.Summary, error)
- func (r *SummaryRepository) GetByUserWithin(user *models.User, from, to time.Time) ([]*models.Summary, error)
- func (r *SummaryRepository) GetLastByUser() ([]*models.TimeByUser, error)
- func (r *SummaryRepository) Insert(summary *models.Summary) error
- type UserRepository
- func (r *UserRepository) Count() (int64, error)
- func (r *UserRepository) Delete(user *models.User) error
- func (r *UserRepository) FindOne(attributes models.User) (*models.User, error)
- func (r *UserRepository) GetAll() ([]*models.User, error)
- func (r *UserRepository) GetAllByLeaderboard(leaderboardEnabled bool) ([]*models.User, error)
- func (r *UserRepository) GetAllByReports(reportsEnabled bool) ([]*models.User, error)
- func (r *UserRepository) GetByIds(userIds []string) ([]*models.User, error)
- func (r *UserRepository) GetByLastActiveAfter(t time.Time) ([]*models.User, error)
- func (r *UserRepository) GetByLoggedInAfter(t time.Time) ([]*models.User, error)
- func (r *UserRepository) GetByLoggedInBefore(t time.Time) ([]*models.User, error)
- func (r *UserRepository) GetMany(ids []string) ([]*models.User, error)
- func (r *UserRepository) InsertOrGet(user *models.User) (*models.User, bool, error)
- func (r *UserRepository) Update(user *models.User) (*models.User, error)
- func (r *UserRepository) UpdateField(user *models.User, key string, value interface{}) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliasRepository ¶
type AliasRepository struct {
// contains filtered or unexported fields
}
func NewAliasRepository ¶
func NewAliasRepository(db *gorm.DB) *AliasRepository
func (*AliasRepository) Delete ¶
func (r *AliasRepository) Delete(id uint) error
func (*AliasRepository) DeleteBatch ¶
func (r *AliasRepository) DeleteBatch(ids []uint) error
func (*AliasRepository) GetByUser ¶
func (r *AliasRepository) GetByUser(userId string) ([]*models.Alias, error)
func (*AliasRepository) GetByUserAndKey ¶
func (r *AliasRepository) GetByUserAndKey(userId, key string) ([]*models.Alias, error)
func (*AliasRepository) GetByUserAndKeyAndType ¶
func (*AliasRepository) GetByUserAndTypeAndValue ¶
type DiagnosticsRepository ¶
type DiagnosticsRepository struct {
// contains filtered or unexported fields
}
func NewDiagnosticsRepository ¶
func NewDiagnosticsRepository(db *gorm.DB) *DiagnosticsRepository
func (*DiagnosticsRepository) Insert ¶
func (r *DiagnosticsRepository) Insert(diagnostics *models.Diagnostics) (*models.Diagnostics, error)
type HeartbeatRepository ¶
type HeartbeatRepository struct {
// contains filtered or unexported fields
}
func NewHeartbeatRepository ¶
func NewHeartbeatRepository(db *gorm.DB) *HeartbeatRepository
func (*HeartbeatRepository) Count ¶
func (r *HeartbeatRepository) Count(approximate bool) (count int64, err error)
func (*HeartbeatRepository) CountByUser ¶
func (r *HeartbeatRepository) CountByUser(user *models.User) (int64, error)
func (*HeartbeatRepository) CountByUsers ¶
func (r *HeartbeatRepository) CountByUsers(users []*models.User) ([]*models.CountByUser, error)
func (*HeartbeatRepository) DeleteBefore ¶
func (r *HeartbeatRepository) DeleteBefore(t time.Time) error
func (*HeartbeatRepository) DeleteByUser ¶
func (r *HeartbeatRepository) DeleteByUser(user *models.User) error
func (*HeartbeatRepository) DeleteByUserBefore ¶
func (*HeartbeatRepository) GetAll ¶
func (r *HeartbeatRepository) GetAll() ([]*models.Heartbeat, error)
Use with caution!!
func (*HeartbeatRepository) GetAllWithin ¶
func (*HeartbeatRepository) GetAllWithinByFilters ¶
func (*HeartbeatRepository) GetEntitySetByUser ¶
func (r *HeartbeatRepository) GetEntitySetByUser(entityType uint8, userId string) ([]string, error)
func (*HeartbeatRepository) GetFirstByUsers ¶
func (r *HeartbeatRepository) GetFirstByUsers() ([]*models.TimeByUser, error)
func (*HeartbeatRepository) GetLastByUsers ¶
func (r *HeartbeatRepository) GetLastByUsers() ([]*models.TimeByUser, error)
func (*HeartbeatRepository) GetLatestByFilters ¶
func (*HeartbeatRepository) GetLatestByOriginAndUser ¶
func (*HeartbeatRepository) GetLatestByUser ¶
func (*HeartbeatRepository) GetUserProjectStats ¶
func (r *HeartbeatRepository) GetUserProjectStats(user *models.User, from, to time.Time, limit, offset int) ([]*models.ProjectStats, error)
func (*HeartbeatRepository) InsertBatch ¶
func (r *HeartbeatRepository) InsertBatch(heartbeats []*models.Heartbeat) error
type IAliasRepository ¶
type IAliasRepository interface { Insert(*models.Alias) (*models.Alias, error) Delete(uint) error DeleteBatch([]uint) error GetAll() ([]*models.Alias, error) GetByUser(string) ([]*models.Alias, error) GetByUserAndKey(string, string) ([]*models.Alias, error) GetByUserAndKeyAndType(string, string, uint8) ([]*models.Alias, error) GetByUserAndTypeAndValue(string, uint8, string) (*models.Alias, error) }
type IDiagnosticsRepository ¶
type IDiagnosticsRepository interface {
Insert(diagnostics *models.Diagnostics) (*models.Diagnostics, error)
}
type IHeartbeatRepository ¶
type IHeartbeatRepository interface { InsertBatch([]*models.Heartbeat) error GetAll() ([]*models.Heartbeat, error) GetAllWithin(time.Time, time.Time, *models.User) ([]*models.Heartbeat, error) GetAllWithinByFilters(time.Time, time.Time, *models.User, map[string][]string) ([]*models.Heartbeat, error) GetLatestByFilters(*models.User, map[string][]string) (*models.Heartbeat, error) GetFirstByUsers() ([]*models.TimeByUser, error) GetLastByUsers() ([]*models.TimeByUser, error) GetLatestByUser(*models.User) (*models.Heartbeat, error) GetLatestByOriginAndUser(string, *models.User) (*models.Heartbeat, error) Count(bool) (int64, error) CountByUser(*models.User) (int64, error) CountByUsers([]*models.User) ([]*models.CountByUser, error) GetEntitySetByUser(uint8, string) ([]string, error) DeleteBefore(time.Time) error DeleteByUser(*models.User) error DeleteByUserBefore(*models.User, time.Time) error GetUserProjectStats(*models.User, time.Time, time.Time, int, int) ([]*models.ProjectStats, error) }
type IKeyValueRepository ¶
type IKeyValueRepository interface { GetAll() ([]*models.KeyStringValue, error) GetString(string) (*models.KeyStringValue, error) PutString(*models.KeyStringValue) error DeleteString(string) error Search(string) ([]*models.KeyStringValue, error) }
type ILanguageMappingRepository ¶
type ILanguageMappingRepository interface { GetAll() ([]*models.LanguageMapping, error) GetById(uint) (*models.LanguageMapping, error) GetByUser(string) ([]*models.LanguageMapping, error) Insert(*models.LanguageMapping) (*models.LanguageMapping, error) Delete(uint) error }
type ILeaderboardRepository ¶
type ILeaderboardRepository interface { InsertBatch([]*models.LeaderboardItem) error CountAllByUser(string) (int64, error) CountUsers(bool) (int64, error) DeleteByUser(string) error DeleteByUserAndInterval(string, *models.IntervalKey) error GetAllAggregatedByInterval(*models.IntervalKey, *uint8, int, int) ([]*models.LeaderboardItemRanked, error) GetAggregatedByUserAndInterval(string, *models.IntervalKey, *uint8, int, int) ([]*models.LeaderboardItemRanked, error) }
type IProjectLabelRepository ¶
type IProjectLabelRepository interface { GetAll() ([]*models.ProjectLabel, error) GetById(uint) (*models.ProjectLabel, error) GetByUser(string) ([]*models.ProjectLabel, error) Insert(*models.ProjectLabel) (*models.ProjectLabel, error) Delete(uint) error }
type ISummaryRepository ¶
type IUserRepository ¶
type IUserRepository interface { FindOne(user models.User) (*models.User, error) GetByIds([]string) ([]*models.User, error) GetAll() ([]*models.User, error) GetMany([]string) ([]*models.User, error) GetAllByReports(bool) ([]*models.User, error) GetAllByLeaderboard(bool) ([]*models.User, error) GetByLoggedInBefore(time.Time) ([]*models.User, error) GetByLoggedInAfter(time.Time) ([]*models.User, error) GetByLastActiveAfter(time.Time) ([]*models.User, error) Count() (int64, error) InsertOrGet(*models.User) (*models.User, bool, error) Update(*models.User) (*models.User, error) UpdateField(*models.User, string, interface{}) (*models.User, error) Delete(*models.User) error }
type KeyValueRepository ¶
type KeyValueRepository struct {
// contains filtered or unexported fields
}
func NewKeyValueRepository ¶
func NewKeyValueRepository(db *gorm.DB) *KeyValueRepository
func (*KeyValueRepository) DeleteString ¶
func (r *KeyValueRepository) DeleteString(key string) error
func (*KeyValueRepository) GetAll ¶
func (r *KeyValueRepository) GetAll() ([]*models.KeyStringValue, error)
func (*KeyValueRepository) GetString ¶
func (r *KeyValueRepository) GetString(key string) (*models.KeyStringValue, error)
func (*KeyValueRepository) PutString ¶
func (r *KeyValueRepository) PutString(kv *models.KeyStringValue) error
func (*KeyValueRepository) Search ¶
func (r *KeyValueRepository) Search(like string) ([]*models.KeyStringValue, error)
type LanguageMappingRepository ¶
type LanguageMappingRepository struct {
// contains filtered or unexported fields
}
func NewLanguageMappingRepository ¶
func NewLanguageMappingRepository(db *gorm.DB) *LanguageMappingRepository
func (*LanguageMappingRepository) Delete ¶
func (r *LanguageMappingRepository) Delete(id uint) error
func (*LanguageMappingRepository) GetAll ¶
func (r *LanguageMappingRepository) GetAll() ([]*models.LanguageMapping, error)
func (*LanguageMappingRepository) GetById ¶
func (r *LanguageMappingRepository) GetById(id uint) (*models.LanguageMapping, error)
func (*LanguageMappingRepository) GetByUser ¶
func (r *LanguageMappingRepository) GetByUser(userId string) ([]*models.LanguageMapping, error)
func (*LanguageMappingRepository) Insert ¶
func (r *LanguageMappingRepository) Insert(mapping *models.LanguageMapping) (*models.LanguageMapping, error)
type LeaderboardRepository ¶
type LeaderboardRepository struct {
// contains filtered or unexported fields
}
func NewLeaderboardRepository ¶
func NewLeaderboardRepository(db *gorm.DB) *LeaderboardRepository
func (*LeaderboardRepository) CountAllByUser ¶
func (r *LeaderboardRepository) CountAllByUser(userId string) (int64, error)
func (*LeaderboardRepository) CountUsers ¶
func (r *LeaderboardRepository) CountUsers(excludeZero bool) (int64, error)
func (*LeaderboardRepository) DeleteByUser ¶
func (r *LeaderboardRepository) DeleteByUser(userId string) error
func (*LeaderboardRepository) DeleteByUserAndInterval ¶
func (r *LeaderboardRepository) DeleteByUserAndInterval(userId string, key *models.IntervalKey) error
func (*LeaderboardRepository) GetAggregatedByUserAndInterval ¶
func (r *LeaderboardRepository) GetAggregatedByUserAndInterval(userId string, key *models.IntervalKey, by *uint8, limit, skip int) ([]*models.LeaderboardItemRanked, error)
func (*LeaderboardRepository) GetAllAggregatedByInterval ¶
func (r *LeaderboardRepository) GetAllAggregatedByInterval(key *models.IntervalKey, by *uint8, limit, skip int) ([]*models.LeaderboardItemRanked, error)
func (*LeaderboardRepository) InsertBatch ¶
func (r *LeaderboardRepository) InsertBatch(items []*models.LeaderboardItem) error
type MetricsRepository ¶
type MetricsRepository struct {
// contains filtered or unexported fields
}
func NewMetricsRepository ¶
func NewMetricsRepository(db *gorm.DB) *MetricsRepository
func (*MetricsRepository) GetDatabaseSize ¶
func (srv *MetricsRepository) GetDatabaseSize() (size int64, err error)
type ProjectLabelRepository ¶
type ProjectLabelRepository struct {
// contains filtered or unexported fields
}
func NewProjectLabelRepository ¶
func NewProjectLabelRepository(db *gorm.DB) *ProjectLabelRepository
func (*ProjectLabelRepository) Delete ¶
func (r *ProjectLabelRepository) Delete(id uint) error
func (*ProjectLabelRepository) GetAll ¶
func (r *ProjectLabelRepository) GetAll() ([]*models.ProjectLabel, error)
func (*ProjectLabelRepository) GetById ¶
func (r *ProjectLabelRepository) GetById(id uint) (*models.ProjectLabel, error)
func (*ProjectLabelRepository) GetByUser ¶
func (r *ProjectLabelRepository) GetByUser(userId string) ([]*models.ProjectLabel, error)
func (*ProjectLabelRepository) Insert ¶
func (r *ProjectLabelRepository) Insert(label *models.ProjectLabel) (*models.ProjectLabel, error)
type SummaryRepository ¶
type SummaryRepository struct {
// contains filtered or unexported fields
}
func NewSummaryRepository ¶
func NewSummaryRepository(db *gorm.DB) *SummaryRepository
func (*SummaryRepository) DeleteByUser ¶
func (r *SummaryRepository) DeleteByUser(userId string) error
func (*SummaryRepository) DeleteByUserBefore ¶
func (r *SummaryRepository) DeleteByUserBefore(userId string, t time.Time) error
func (*SummaryRepository) GetByUserWithin ¶
func (*SummaryRepository) GetLastByUser ¶
func (r *SummaryRepository) GetLastByUser() ([]*models.TimeByUser, error)
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(db *gorm.DB) *UserRepository
func (*UserRepository) Count ¶
func (r *UserRepository) Count() (int64, error)
func (*UserRepository) GetAllByLeaderboard ¶
func (r *UserRepository) GetAllByLeaderboard(leaderboardEnabled bool) ([]*models.User, error)
func (*UserRepository) GetAllByReports ¶
func (r *UserRepository) GetAllByReports(reportsEnabled bool) ([]*models.User, error)
func (*UserRepository) GetByIds ¶
func (r *UserRepository) GetByIds(userIds []string) ([]*models.User, error)
func (*UserRepository) GetByLastActiveAfter ¶
Returns a list of user ids, whose last heartbeat is not older than t NOTE: Only ID field will be populated
func (*UserRepository) GetByLoggedInAfter ¶
func (*UserRepository) GetByLoggedInBefore ¶
func (*UserRepository) GetMany ¶
func (r *UserRepository) GetMany(ids []string) ([]*models.User, error)
func (*UserRepository) InsertOrGet ¶
func (*UserRepository) UpdateField ¶
Click to show internal directories.
Click to hide internal directories.