repositories

package
Version: v0.0.0-...-2650804 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

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) GetAll

func (r *AliasRepository) GetAll() ([]*models.Alias, 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 (r *AliasRepository) GetByUserAndKeyAndType(userId, key string, summaryType uint8) ([]*models.Alias, error)

func (*AliasRepository) GetByUserAndTypeAndValue

func (r *AliasRepository) GetByUserAndTypeAndValue(userId string, summaryType uint8, value string) (*models.Alias, error)

func (*AliasRepository) Insert

func (r *AliasRepository) Insert(alias *models.Alias) (*models.Alias, error)

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() (int64, 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) GetAll

func (r *HeartbeatRepository) GetAll() ([]*models.Heartbeat, error)

Use with caution!!

func (*HeartbeatRepository) GetAllWithin

func (r *HeartbeatRepository) GetAllWithin(from, to time.Time, user *models.User) ([]*models.Heartbeat, error)

func (HeartbeatRepository) GetEntitySetByUser

func (r HeartbeatRepository) GetEntitySetByUser(entityType uint8, user *models.User) ([]string, error)

func (*HeartbeatRepository) GetFirstByUsers

func (r *HeartbeatRepository) GetFirstByUsers() ([]*models.TimeByUser, error)

func (*HeartbeatRepository) GetLastByUsers

func (r *HeartbeatRepository) GetLastByUsers() ([]*models.TimeByUser, error)

func (*HeartbeatRepository) GetLatestByOriginAndUser

func (r *HeartbeatRepository) GetLatestByOriginAndUser(origin string, user *models.User) (*models.Heartbeat, error)

func (*HeartbeatRepository) GetLatestByUser

func (r *HeartbeatRepository) GetLatestByUser(user *models.User) (*models.Heartbeat, 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)
	GetFirstByUsers() ([]*models.TimeByUser, error)
	GetLastByUsers() ([]*models.TimeByUser, error)
	GetLatestByUser(*models.User) (*models.Heartbeat, error)
	GetLatestByOriginAndUser(string, *models.User) (*models.Heartbeat, error)
	Count() (int64, error)
	CountByUser(*models.User) (int64, error)
	CountByUsers([]*models.User) ([]*models.CountByUser, error)
	GetEntitySetByUser(uint8, *models.User) ([]string, error)
	DeleteBefore(time.Time) error
}

type IKeyValueRepository

type IKeyValueRepository interface {
	GetAll() ([]*models.KeyStringValue, error)
	GetString(string) (*models.KeyStringValue, error)
	PutString(*models.KeyStringValue) error
	DeleteString(string) 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 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 ISummaryRepository interface {
	Insert(*models.Summary) error
	GetAll() ([]*models.Summary, error)
	GetByUserWithin(*models.User, time.Time, time.Time) ([]*models.Summary, error)
	GetLastByUser() ([]*models.TimeByUser, error)
	DeleteByUser(string) error
}

type IUserRepository

type IUserRepository interface {
	GetById(string) (*models.User, error)
	GetByIds([]string) ([]*models.User, error)
	GetByApiKey(string) (*models.User, error)
	GetByEmail(string) (*models.User, error)
	GetByResetToken(string) (*models.User, error)
	GetAll() ([]*models.User, error)
	GetAllByReports(bool) ([]*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

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 (*LanguageMappingRepository) GetById

func (*LanguageMappingRepository) GetByUser

func (r *LanguageMappingRepository) GetByUser(userId string) ([]*models.LanguageMapping, error)

func (*LanguageMappingRepository) Insert

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 (*ProjectLabelRepository) GetByUser

func (r *ProjectLabelRepository) GetByUser(userId string) ([]*models.ProjectLabel, error)

func (*ProjectLabelRepository) Insert

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) GetAll

func (r *SummaryRepository) GetAll() ([]*models.Summary, error)

func (*SummaryRepository) GetByUserWithin

func (r *SummaryRepository) GetByUserWithin(user *models.User, from, to time.Time) ([]*models.Summary, error)

func (*SummaryRepository) GetLastByUser

func (r *SummaryRepository) GetLastByUser() ([]*models.TimeByUser, error)

func (*SummaryRepository) Insert

func (r *SummaryRepository) Insert(summary *models.Summary) 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) Delete

func (r *UserRepository) Delete(user *models.User) error

func (*UserRepository) GetAll

func (r *UserRepository) GetAll() ([]*models.User, error)

func (*UserRepository) GetAllByReports

func (r *UserRepository) GetAllByReports(reportsEnabled bool) ([]*models.User, error)

func (*UserRepository) GetByApiKey

func (r *UserRepository) GetByApiKey(key string) (*models.User, error)

func (*UserRepository) GetByEmail

func (r *UserRepository) GetByEmail(email string) (*models.User, error)

func (*UserRepository) GetById

func (r *UserRepository) GetById(userId string) (*models.User, error)

func (*UserRepository) GetByIds

func (r *UserRepository) GetByIds(userIds []string) ([]*models.User, error)

func (*UserRepository) GetByLastActiveAfter

func (r *UserRepository) GetByLastActiveAfter(t time.Time) ([]*models.User, error)

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 (r *UserRepository) GetByLoggedInAfter(t time.Time) ([]*models.User, error)

func (*UserRepository) GetByResetToken

func (r *UserRepository) GetByResetToken(resetToken string) (*models.User, error)

func (*UserRepository) InsertOrGet

func (r *UserRepository) InsertOrGet(user *models.User) (*models.User, bool, error)

func (*UserRepository) Update

func (r *UserRepository) Update(user *models.User) (*models.User, error)

func (*UserRepository) UpdateField

func (r *UserRepository) UpdateField(user *models.User, key string, value interface{}) (*models.User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL