Documentation ¶
Index ¶
- func GetDBManagerInstance() *dbManager
- type AdminDB
- func (a *AdminDB[T]) Add(admin *models.Admin) error
- func (a *AdminDB[T]) AddMany(admins []*models.Admin) error
- func (a *AdminDB[T]) Count() (int64, error)
- func (a *AdminDB[T]) Delete(admin models.Admin, conds ...any) error
- func (a *AdminDB[T]) DeleteAll(conds ...any) error
- func (a *AdminDB[T]) Exists(id uint) bool
- func (a *AdminDB[T]) Get(id uint) (fetchedAdmin models.Admin, err error)
- func (a *AdminDB[T]) GetAll() ([]models.Admin, error)
- func (a *AdminDB[T]) GetByConds(conds ...any) ([]models.Admin, error)
- func (a *AdminDB[T]) GetDB() *gorm.DB
- func (a *AdminDB[T]) Update(admin *models.Admin, conds ...any) error
- func (a *AdminDB[T]) UpdateAll(admins []*models.Admin, conds ...any) error
- type ContestDB
- func (c *ContestDB[T, T2]) Add(contest *models.Contest) error
- func (c *ContestDB[T, T2]) AddMany(contests []*models.Contest) error
- func (c *ContestDB[T, T2]) Count() (int64, error)
- func (c *ContestDB[T, T2]) Delete(contest models.Contest, conds ...any) error
- func (c *ContestDB[T, T2]) DeleteAll(conds ...any) error
- func (c *ContestDB[T, T2]) Exists(id uint) bool
- func (c *ContestDB[T, T2]) Get(id uint) (fetchedContest models.Contest, err error)
- func (c *ContestDB[T, T2]) GetAll() (contests []models.Contest, err error)
- func (c *ContestDB[T, T2]) GetByAssociation(org any) (contests []models.Contest, err error)
- func (c *ContestDB[T, T2]) GetByConds(conds ...any) ([]models.Contest, error)
- func (c *ContestDB[T, T2]) GetDB() *gorm.DB
- func (c *ContestDB[T, T2]) Update(contest *models.Contest, conds ...any) error
- func (c *ContestDB[T, T2]) UpdateAll(contests []*models.Contest, conds ...any) error
- type ContestantDB
- func (c *ContestantDB[T]) Add(contestant *models.Contestant) error
- func (c *ContestantDB[T]) AddMany(conts []*models.Contestant) error
- func (c *ContestantDB[T]) Count() (int64, error)
- func (c *ContestantDB[T]) Delete(contestant models.Contestant, conds ...any) error
- func (c *ContestantDB[T]) DeleteAll(conds ...any) error
- func (c *ContestantDB[T]) Exists(userID uint) bool
- func (c *ContestantDB[T]) Get(userID uint) (fetchedContestant models.Contestant, err error)
- func (c *ContestantDB[T]) GetAll() ([]models.Contestant, error)
- func (c *ContestantDB[T]) GetByConds(conds ...any) ([]models.Contestant, error)
- func (c *ContestantDB[T]) GetDB() *gorm.DB
- func (c *ContestantDB[T]) Update(cont *models.Contestant, conds ...any) error
- func (c *ContestantDB[T]) UpdateAll(conts []*models.Contestant, conds ...any) error
- type JoinRequestDB
- func (j *JoinRequestDB[T]) Add(jr *models.JoinRequest) error
- func (j *JoinRequestDB[T]) AddMany(jr []*models.JoinRequest) error
- func (j *JoinRequestDB[T]) Count() (count int64, err error)
- func (j *JoinRequestDB[T]) Delete(jr models.JoinRequest, conds ...any) error
- func (j *JoinRequestDB[T]) DeleteAll(conds ...any) error
- func (j *JoinRequestDB[T]) Exists(id uint) bool
- func (j *JoinRequestDB[T]) Get(id uint) (jr models.JoinRequest, err error)
- func (j *JoinRequestDB[T]) GetAll() (jr []models.JoinRequest, err error)
- func (j *JoinRequestDB[T]) GetByConds(conds ...any) (jrs []models.JoinRequest, err error)
- func (j *JoinRequestDB[T]) GetDB() *gorm.DB
- func (j *JoinRequestDB[T]) Update(jr *models.JoinRequest, conds ...any) error
- func (j *JoinRequestDB[T]) UpdateAll(jrs []*models.JoinRequest, conds ...any) error
- type NotificationDB
- func (n *NotificationDB[T]) Add(notification *models.Notification) error
- func (n *NotificationDB[T]) AddMany(notifications []*models.Notification) error
- func (n *NotificationDB[T]) Count() (int64, error)
- func (n *NotificationDB[T]) Delete(notification models.Notification, conds ...any) error
- func (n *NotificationDB[T]) DeleteAll(conds ...any) error
- func (n *NotificationDB[T]) Exists(nID uint) bool
- func (n *NotificationDB[T]) Get(nID uint) (notification models.Notification, err error)
- func (n *NotificationDB[T]) GetAll() ([]models.Notification, error)
- func (n *NotificationDB[T]) GetByConds(conds ...any) (notifications []models.Notification, err error)
- func (n *NotificationDB[T]) GetDB() *gorm.DB
- func (n *NotificationDB[T]) Update(notification *models.Notification, conds ...any) error
- func (n *NotificationDB[T]) UpdateAll(notifications []*models.Notification, conds ...any) error
- type OrganizeContestDB
- func (c *OrganizeContestDB) Add(oc *models.OrganizeContest) error
- func (c *OrganizeContestDB) Count() (int64, error)
- func (c *OrganizeContestDB) Delete(oc models.OrganizeContest) error
- func (c *OrganizeContestDB) DeleteAll() error
- func (c *OrganizeContestDB) Exists(oc models.OrganizeContest) (bool, error)
- func (c *OrganizeContestDB) Get(oc models.OrganizeContest) (fetchedOC models.OrganizeContest, err error)
- func (c *OrganizeContestDB) GetContests(org models.Organizer) (contests []models.Contest, err error)
- func (c *OrganizeContestDB) GetOrgs(contest models.Contest) (orgs []models.Organizer, err error)
- func (c *OrganizeContestDB) Update(oc *models.OrganizeContest) error
- type OrganizerDB
- func (o *OrganizerDB[T]) Add(organizer *models.Organizer) error
- func (o *OrganizerDB[T]) AddMany(orgs []*models.Organizer) error
- func (o *OrganizerDB[T]) Count() (int64, error)
- func (o *OrganizerDB[T]) Delete(organizer models.Organizer, conds ...any) error
- func (o *OrganizerDB[T]) DeleteAll(conds ...any) error
- func (o *OrganizerDB[T]) Exists(userID uint) bool
- func (o *OrganizerDB[T]) Get(userID uint) (fetchedOrganizer models.Organizer, err error)
- func (o *OrganizerDB[T]) GetAll() ([]models.Organizer, error)
- func (o *OrganizerDB[T]) GetByConds(conds ...any) ([]models.Organizer, error)
- func (o *OrganizerDB[T]) GetDB() *gorm.DB
- func (o *OrganizerDB[T]) Update(organizer *models.Organizer, conds ...any) error
- func (o *OrganizerDB[T]) UpdateAll(orgs []*models.Organizer, conds ...any) error
- type SessionDB
- func (s *SessionDB[T]) Add(session *models.Session) error
- func (s *SessionDB[T]) AddMany(sessions []*models.Session) error
- func (s *SessionDB[T]) Count() (int64, error)
- func (s *SessionDB[T]) Delete(session models.Session, conds ...any) error
- func (s *SessionDB[T]) DeleteAll(conds ...any) error
- func (s *SessionDB[T]) Exists(id uint) bool
- func (s *SessionDB[T]) Get(id uint) (models.Session, error)
- func (s *SessionDB[T]) GetAll() ([]models.Session, error)
- func (s *SessionDB[T]) GetByConds(conds ...any) (sessions []models.Session, err error)
- func (s *SessionDB[T]) GetDB() *gorm.DB
- func (s *SessionDB[T]) Update(session *models.Session, conds ...any) error
- func (s *SessionDB[T]) UpdateAll(sessions []*models.Session, conds ...any) error
- type TeamDB
- func (t *TeamDB[T, T2]) Add(team *models.Team) error
- func (t *TeamDB[T, T2]) AddMany(teams []*models.Team) error
- func (t *TeamDB[T, T2]) Count() (int64, error)
- func (t *TeamDB[T, T2]) Delete(team models.Team, conds ...any) error
- func (t *TeamDB[T, T2]) DeleteAll(conds ...any) error
- func (t *TeamDB[T, T2]) Exists(id uint) bool
- func (t *TeamDB[T, T2]) Get(id uint) (fetchedTeam models.Team, err error)
- func (t *TeamDB[T, T2]) GetAll() (teams []models.Team, err error)
- func (t *TeamDB[T, T2]) GetByAssociation(contest any) ([]models.Team, error)
- func (t *TeamDB[T, T2]) GetByConds(conds ...any) (teams []models.Team, err error)
- func (t *TeamDB[T, T2]) GetDB() *gorm.DB
- func (t *TeamDB[T, T2]) Update(team *models.Team, conds ...any) error
- func (t *TeamDB[T, T2]) UpdateAll(teams []*models.Team, conds ...any) error
- type UserDB
- func (u *UserDB[T]) Add(user *models.User) error
- func (u *UserDB[T]) AddMany(users []*models.User) error
- func (u *UserDB[T]) Count() (count int64, err error)
- func (u *UserDB[T]) Delete(user models.User, conds ...any) error
- func (u *UserDB[T]) DeleteAll(conds ...any) error
- func (u *UserDB[T]) Exists(userID uint) bool
- func (u *UserDB[T]) Get(userID uint) (fetchedUser models.User, err error)
- func (u *UserDB[T]) GetAll() (users []models.User, err error)
- func (u *UserDB[T]) GetByConds(conds ...any) (users []models.User, err error)
- func (u *UserDB[T]) GetDB() *gorm.DB
- func (u *UserDB[T]) Update(user *models.User, conds ...any) (err error)
- func (u *UserDB[T]) UpdateAll(users []*models.User, conds ...any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDBManagerInstance ¶
func GetDBManagerInstance() *dbManager
Types ¶
type AdminDB ¶
func (*AdminDB[T]) GetByConds ¶
type ContestDB ¶
ContestDB represents a CRUD db repo for contests
func NewContestDB ¶
func NewContestDB(db *gorm.DB, teamRepo data.Many2ManyCRUDRepo[models.Team, any]) *ContestDB[models.Contest, any]
NewContestDB returns a new ContestDB instance
func (*ContestDB[T, T2]) GetByAssociation ¶
func (*ContestDB[T, T2]) GetByConds ¶
type ContestantDB ¶
type ContestantDB[T models.Contestant] struct { // contains filtered or unexported fields }
ContestantDB represents a CRUD db repo for contestants
func NewContestantDB ¶
func NewContestantDB(db *gorm.DB) *ContestantDB[models.Contestant]
NewContestantDB returns a new ContestantDB instance
func (*ContestantDB[T]) Add ¶
func (c *ContestantDB[T]) Add(contestant *models.Contestant) error
func (*ContestantDB[T]) AddMany ¶
func (c *ContestantDB[T]) AddMany(conts []*models.Contestant) error
func (*ContestantDB[T]) Count ¶
func (c *ContestantDB[T]) Count() (int64, error)
func (*ContestantDB[T]) Delete ¶
func (c *ContestantDB[T]) Delete(contestant models.Contestant, conds ...any) error
func (*ContestantDB[T]) DeleteAll ¶
func (c *ContestantDB[T]) DeleteAll(conds ...any) error
func (*ContestantDB[T]) Exists ¶
func (c *ContestantDB[T]) Exists(userID uint) bool
func (*ContestantDB[T]) Get ¶
func (c *ContestantDB[T]) Get(userID uint) (fetchedContestant models.Contestant, err error)
func (*ContestantDB[T]) GetAll ¶
func (c *ContestantDB[T]) GetAll() ([]models.Contestant, error)
func (*ContestantDB[T]) GetByConds ¶
func (c *ContestantDB[T]) GetByConds(conds ...any) ([]models.Contestant, error)
func (*ContestantDB[T]) GetDB ¶
func (c *ContestantDB[T]) GetDB() *gorm.DB
func (*ContestantDB[T]) Update ¶
func (c *ContestantDB[T]) Update(cont *models.Contestant, conds ...any) error
func (*ContestantDB[T]) UpdateAll ¶
func (c *ContestantDB[T]) UpdateAll(conts []*models.Contestant, conds ...any) error
type JoinRequestDB ¶
type JoinRequestDB[T models.JoinRequest] struct { // contains filtered or unexported fields }
JoinRequestDB represents a CRUD db repo for jrs
func NewJoinRequestDB ¶
func NewJoinRequestDB(db *gorm.DB) *JoinRequestDB[models.JoinRequest]
NewJoinRequestDB returns a new JoinRequestDB instance
func (*JoinRequestDB[T]) Add ¶
func (j *JoinRequestDB[T]) Add(jr *models.JoinRequest) error
func (*JoinRequestDB[T]) AddMany ¶
func (j *JoinRequestDB[T]) AddMany(jr []*models.JoinRequest) error
func (*JoinRequestDB[T]) Count ¶
func (j *JoinRequestDB[T]) Count() (count int64, err error)
func (*JoinRequestDB[T]) Delete ¶
func (j *JoinRequestDB[T]) Delete(jr models.JoinRequest, conds ...any) error
func (*JoinRequestDB[T]) DeleteAll ¶
func (j *JoinRequestDB[T]) DeleteAll(conds ...any) error
func (*JoinRequestDB[T]) Exists ¶
func (j *JoinRequestDB[T]) Exists(id uint) bool
func (*JoinRequestDB[T]) Get ¶
func (j *JoinRequestDB[T]) Get(id uint) (jr models.JoinRequest, err error)
func (*JoinRequestDB[T]) GetAll ¶
func (j *JoinRequestDB[T]) GetAll() (jr []models.JoinRequest, err error)
func (*JoinRequestDB[T]) GetByConds ¶
func (j *JoinRequestDB[T]) GetByConds(conds ...any) (jrs []models.JoinRequest, err error)
func (*JoinRequestDB[T]) GetDB ¶
func (j *JoinRequestDB[T]) GetDB() *gorm.DB
func (*JoinRequestDB[T]) Update ¶
func (j *JoinRequestDB[T]) Update(jr *models.JoinRequest, conds ...any) error
func (*JoinRequestDB[T]) UpdateAll ¶
func (j *JoinRequestDB[T]) UpdateAll(jrs []*models.JoinRequest, conds ...any) error
type NotificationDB ¶
type NotificationDB[T models.Notification] struct { // contains filtered or unexported fields }
NotificationDB represents a CRUD db repo for notifications
func NewNotificationDB ¶
func NewNotificationDB(db *gorm.DB) *NotificationDB[models.Notification]
NewNotificationDB returns a new NotificationDB instance
func (*NotificationDB[T]) Add ¶
func (n *NotificationDB[T]) Add(notification *models.Notification) error
func (*NotificationDB[T]) AddMany ¶
func (n *NotificationDB[T]) AddMany(notifications []*models.Notification) error
func (*NotificationDB[T]) Count ¶
func (n *NotificationDB[T]) Count() (int64, error)
func (*NotificationDB[T]) Delete ¶
func (n *NotificationDB[T]) Delete(notification models.Notification, conds ...any) error
func (*NotificationDB[T]) DeleteAll ¶
func (n *NotificationDB[T]) DeleteAll(conds ...any) error
func (*NotificationDB[T]) Exists ¶
func (n *NotificationDB[T]) Exists(nID uint) bool
func (*NotificationDB[T]) Get ¶
func (n *NotificationDB[T]) Get(nID uint) (notification models.Notification, err error)
func (*NotificationDB[T]) GetAll ¶
func (n *NotificationDB[T]) GetAll() ([]models.Notification, error)
func (*NotificationDB[T]) GetByConds ¶
func (n *NotificationDB[T]) GetByConds(conds ...any) (notifications []models.Notification, err error)
func (*NotificationDB[T]) GetDB ¶
func (n *NotificationDB[T]) GetDB() *gorm.DB
func (*NotificationDB[T]) Update ¶
func (n *NotificationDB[T]) Update(notification *models.Notification, conds ...any) error
func (*NotificationDB[T]) UpdateAll ¶
func (n *NotificationDB[T]) UpdateAll(notifications []*models.Notification, conds ...any) error
type OrganizeContestDB ¶
type OrganizeContestDB struct {
// contains filtered or unexported fields
}
func NewOrganizeOrganizeContestDB ¶
func NewOrganizeOrganizeContestDB(db *gorm.DB) *OrganizeContestDB
func (*OrganizeContestDB) Add ¶
func (c *OrganizeContestDB) Add(oc *models.OrganizeContest) error
func (*OrganizeContestDB) Count ¶
func (c *OrganizeContestDB) Count() (int64, error)
func (*OrganizeContestDB) Delete ¶
func (c *OrganizeContestDB) Delete(oc models.OrganizeContest) error
func (*OrganizeContestDB) DeleteAll ¶
func (c *OrganizeContestDB) DeleteAll() error
func (*OrganizeContestDB) Exists ¶
func (c *OrganizeContestDB) Exists(oc models.OrganizeContest) (bool, error)
func (*OrganizeContestDB) Get ¶
func (c *OrganizeContestDB) Get(oc models.OrganizeContest) (fetchedOC models.OrganizeContest, err error)
func (*OrganizeContestDB) GetContests ¶
func (*OrganizeContestDB) Update ¶
func (c *OrganizeContestDB) Update(oc *models.OrganizeContest) error
type OrganizerDB ¶
OrganizerDB represents a CRUD db repo for organizers
func NewOrganizerDB ¶
func NewOrganizerDB(db *gorm.DB) *OrganizerDB[models.Organizer]
NewOrganizerDB returns a new OrganizerDB instance
func (*OrganizerDB[T]) Count ¶
func (o *OrganizerDB[T]) Count() (int64, error)
func (*OrganizerDB[T]) Delete ¶
func (o *OrganizerDB[T]) Delete(organizer models.Organizer, conds ...any) error
func (*OrganizerDB[T]) DeleteAll ¶
func (o *OrganizerDB[T]) DeleteAll(conds ...any) error
func (*OrganizerDB[T]) Exists ¶
func (o *OrganizerDB[T]) Exists(userID uint) bool
func (*OrganizerDB[T]) Get ¶
func (o *OrganizerDB[T]) Get(userID uint) (fetchedOrganizer models.Organizer, err error)
func (*OrganizerDB[T]) GetByConds ¶
func (o *OrganizerDB[T]) GetByConds(conds ...any) ([]models.Organizer, error)
func (*OrganizerDB[T]) GetDB ¶
func (o *OrganizerDB[T]) GetDB() *gorm.DB
type SessionDB ¶
SessionDB represents a CRUD db repo for sessions
func NewSessionDB ¶
NewSessionDB returns a new SessionDB instance
func (*SessionDB[T]) GetByConds ¶
type TeamDB ¶
TeamDB represents a CRUD db repo for teams
func (*TeamDB[T, T2]) AddMany ¶
AddMany creates multiple teams, this method is only used when a contest's director generates teams for the teamless contestants.