Documentation
¶
Index ¶
- func GetMigrationVersion(db *sql.DB) (uint, bool, error)
- func NewAbsenceRepo(db *DB) repository.AbsenceRepository
- func NewAnnouncementRepo(db *DB) repository.AnnouncementRepository
- func NewClassMemberRepo(db *DB) repository.ClassMemberRepository
- func NewClassRepo(db *DB) repository.ClassRepository
- func NewMessageRepo(db *DB) repository.MessageRepository
- func NewPhotoRepo(db *DB) repository.PhotoRepository
- func NewProfileRepo(db *DB) repository.ProfileRepository
- func NewRefreshTokenRepo(db *DB) repository.RefreshTokenRepository
- func NewUserRepo(db *DB) repository.UserRepository
- func RunMigrations(db *sql.DB) error
- type AbsenceRepo
- func (r *AbsenceRepo) Create(ctx context.Context, absence *domain.Absence) error
- func (r *AbsenceRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *AbsenceRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.Absence, error)
- func (r *AbsenceRepo) ListByClass(ctx context.Context, classID uuid.UUID, limit, offset int) ([]*domain.Absence, error)
- func (r *AbsenceRepo) UpdateStatus(ctx context.Context, id uuid.UUID, status domain.AbsenceStatus) error
- type AnnouncementRepo
- func (r *AnnouncementRepo) Create(ctx context.Context, announcement *domain.Announcement) error
- func (r *AnnouncementRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *AnnouncementRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.Announcement, error)
- func (r *AnnouncementRepo) ListByClass(ctx context.Context, classID *uuid.UUID, limit, offset int) ([]*domain.Announcement, error)
- func (r *AnnouncementRepo) ListGlobal(ctx context.Context, limit, offset int) ([]*domain.Announcement, error)
- func (r *AnnouncementRepo) Update(ctx context.Context, announcement *domain.Announcement) error
- type ClassMemberRepo
- func (r *ClassMemberRepo) Create(ctx context.Context, member *domain.ClassMember) error
- func (r *ClassMemberRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *ClassMemberRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.ClassMember, error)
- func (r *ClassMemberRepo) GetByUserAndClass(ctx context.Context, userID, classID uuid.UUID) (*domain.ClassMember, error)
- func (r *ClassMemberRepo) IsMember(ctx context.Context, userID, classID uuid.UUID) (bool, error)
- func (r *ClassMemberRepo) IsTeacher(ctx context.Context, userID, classID uuid.UUID) (bool, error)
- func (r *ClassMemberRepo) ListByClass(ctx context.Context, classID uuid.UUID) ([]*domain.ClassMember, error)
- func (r *ClassMemberRepo) ListByUser(ctx context.Context, userID uuid.UUID) ([]*domain.ClassMember, error)
- type ClassRepo
- func (r *ClassRepo) Create(ctx context.Context, class *domain.Class) error
- func (r *ClassRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *ClassRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.Class, error)
- func (r *ClassRepo) GetUserClasses(ctx context.Context, userID uuid.UUID) ([]*domain.Class, error)
- func (r *ClassRepo) List(ctx context.Context, limit, offset int) ([]*domain.Class, error)
- func (r *ClassRepo) Update(ctx context.Context, class *domain.Class) error
- type DB
- type MessageRepo
- func (r *MessageRepo) Create(ctx context.Context, message *domain.Message) error
- func (r *MessageRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *MessageRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.Message, error)
- func (r *MessageRepo) ListByUser(ctx context.Context, userID uuid.UUID, limit, offset int) ([]*domain.Message, error)
- func (r *MessageRepo) MarkAsRead(ctx context.Context, id uuid.UUID, readAt time.Time) error
- type PhotoRepo
- func (r *PhotoRepo) Create(ctx context.Context, photo *domain.Photo) error
- func (r *PhotoRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *PhotoRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.Photo, error)
- func (r *PhotoRepo) ListByClass(ctx context.Context, classID uuid.UUID, limit, offset int) ([]*domain.Photo, error)
- type ProfileRepo
- func (r *ProfileRepo) Create(ctx context.Context, profile *domain.Profile) error
- func (r *ProfileRepo) Delete(ctx context.Context, userID uuid.UUID) error
- func (r *ProfileRepo) GetByUserID(ctx context.Context, userID uuid.UUID) (*domain.Profile, error)
- func (r *ProfileRepo) Update(ctx context.Context, profile *domain.Profile) error
- type RefreshTokenRepo
- func (r *RefreshTokenRepo) Create(ctx context.Context, token *domain.RefreshToken) error
- func (r *RefreshTokenRepo) DeleteExpired(ctx context.Context) error
- func (r *RefreshTokenRepo) GetByTokenHash(ctx context.Context, tokenHash string) (*domain.RefreshToken, error)
- func (r *RefreshTokenRepo) Revoke(ctx context.Context, tokenHash string, revokedAt time.Time) error
- func (r *RefreshTokenRepo) RevokeAllForUser(ctx context.Context, userID uuid.UUID, revokedAt time.Time) error
- type UserRepo
- func (r *UserRepo) Create(ctx context.Context, user *domain.User) error
- func (r *UserRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *UserRepo) GetByEmail(ctx context.Context, email string) (*domain.User, error)
- func (r *UserRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.User, error)
- func (r *UserRepo) Update(ctx context.Context, user *domain.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMigrationVersion ¶ added in v0.1.6
GetMigrationVersion returns the current migration version
func NewAbsenceRepo ¶
func NewAbsenceRepo(db *DB) repository.AbsenceRepository
func NewAnnouncementRepo ¶
func NewAnnouncementRepo(db *DB) repository.AnnouncementRepository
func NewClassMemberRepo ¶
func NewClassMemberRepo(db *DB) repository.ClassMemberRepository
func NewClassRepo ¶
func NewClassRepo(db *DB) repository.ClassRepository
func NewMessageRepo ¶
func NewMessageRepo(db *DB) repository.MessageRepository
func NewPhotoRepo ¶
func NewPhotoRepo(db *DB) repository.PhotoRepository
func NewProfileRepo ¶
func NewProfileRepo(db *DB) repository.ProfileRepository
func NewRefreshTokenRepo ¶
func NewRefreshTokenRepo(db *DB) repository.RefreshTokenRepository
func NewUserRepo ¶
func NewUserRepo(db *DB) repository.UserRepository
NewUserRepo creates a new user repository
func RunMigrations ¶ added in v0.1.6
RunMigrations executes all pending database migrations
Types ¶
type AbsenceRepo ¶
type AbsenceRepo struct {
// contains filtered or unexported fields
}
AbsenceRepo implements repository.AbsenceRepository
func (*AbsenceRepo) ListByClass ¶
func (*AbsenceRepo) UpdateStatus ¶
func (r *AbsenceRepo) UpdateStatus(ctx context.Context, id uuid.UUID, status domain.AbsenceStatus) error
type AnnouncementRepo ¶
type AnnouncementRepo struct {
// contains filtered or unexported fields
}
AnnouncementRepo implements repository.AnnouncementRepository
func (*AnnouncementRepo) Create ¶
func (r *AnnouncementRepo) Create(ctx context.Context, announcement *domain.Announcement) error
func (*AnnouncementRepo) GetByID ¶
func (r *AnnouncementRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.Announcement, error)
func (*AnnouncementRepo) ListByClass ¶
func (r *AnnouncementRepo) ListByClass(ctx context.Context, classID *uuid.UUID, limit, offset int) ([]*domain.Announcement, error)
func (*AnnouncementRepo) ListGlobal ¶
func (r *AnnouncementRepo) ListGlobal(ctx context.Context, limit, offset int) ([]*domain.Announcement, error)
func (*AnnouncementRepo) Update ¶
func (r *AnnouncementRepo) Update(ctx context.Context, announcement *domain.Announcement) error
type ClassMemberRepo ¶
type ClassMemberRepo struct {
// contains filtered or unexported fields
}
ClassMemberRepo implements repository.ClassMemberRepository
func (*ClassMemberRepo) Create ¶
func (r *ClassMemberRepo) Create(ctx context.Context, member *domain.ClassMember) error
func (*ClassMemberRepo) GetByID ¶
func (r *ClassMemberRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.ClassMember, error)
func (*ClassMemberRepo) GetByUserAndClass ¶
func (r *ClassMemberRepo) GetByUserAndClass(ctx context.Context, userID, classID uuid.UUID) (*domain.ClassMember, error)
func (*ClassMemberRepo) ListByClass ¶
func (r *ClassMemberRepo) ListByClass(ctx context.Context, classID uuid.UUID) ([]*domain.ClassMember, error)
func (*ClassMemberRepo) ListByUser ¶
func (r *ClassMemberRepo) ListByUser(ctx context.Context, userID uuid.UUID) ([]*domain.ClassMember, error)
type ClassRepo ¶
type ClassRepo struct {
// contains filtered or unexported fields
}
ClassRepo implements repository.ClassRepository
func (*ClassRepo) GetUserClasses ¶
type MessageRepo ¶
type MessageRepo struct {
// contains filtered or unexported fields
}
MessageRepo implements repository.MessageRepository
func (*MessageRepo) ListByUser ¶
func (*MessageRepo) MarkAsRead ¶
type PhotoRepo ¶
type PhotoRepo struct {
// contains filtered or unexported fields
}
PhotoRepo implements repository.PhotoRepository
type ProfileRepo ¶
type ProfileRepo struct {
// contains filtered or unexported fields
}
ProfileRepo implements repository.ProfileRepository
func (*ProfileRepo) GetByUserID ¶
type RefreshTokenRepo ¶
type RefreshTokenRepo struct {
// contains filtered or unexported fields
}
RefreshTokenRepo implements repository.RefreshTokenRepository
func (*RefreshTokenRepo) Create ¶
func (r *RefreshTokenRepo) Create(ctx context.Context, token *domain.RefreshToken) error
func (*RefreshTokenRepo) DeleteExpired ¶
func (r *RefreshTokenRepo) DeleteExpired(ctx context.Context) error
func (*RefreshTokenRepo) GetByTokenHash ¶
func (r *RefreshTokenRepo) GetByTokenHash(ctx context.Context, tokenHash string) (*domain.RefreshToken, error)
func (*RefreshTokenRepo) RevokeAllForUser ¶
Click to show internal directories.
Click to hide internal directories.