Documentation ¶
Index ¶
- Constants
- type ErrorRecorder
- type FollowingTeacher
- func (u *FollowingTeacher) Create(ctx context.Context, followingTeacher *model2.FollowingTeacher) error
- func (u *FollowingTeacher) DeleteFollowingTeachers(ctx context.Context, userID uint, teacherIDs []uint) error
- func (u *FollowingTeacher) FindTeachersByUserID(ctx context.Context, userID uint) ([]*model2.Teacher, error)
- func (u *FollowingTeacher) FollowTeacher(ctx context.Context, user *model2.User, teacher *model2.Teacher) (*model2.FollowingTeacher, bool, error)
- func (u *FollowingTeacher) ReachesFollowingTeacherLimit(ctx context.Context, userID uint, additionalTeachers int) (bool, error)
- type GAMeasurement
- type Lesson
- func (u *Lesson) FindLessons(ctx context.Context, teacherID uint, fromDate, toDate time.Time) ([]*model2.Lesson, error)
- func (u *Lesson) GetNewAvailableLessons(ctx context.Context, oldLessons, newLessons []*model2.Lesson) []*model2.Lesson
- func (u *Lesson) UpdateLessons(ctx context.Context, lessons []*model2.Lesson) (int, error)
- type LessonNotifier
- type Notification
- type NotificationTimeSpan
- type Notifier
- type StatNotifier
- type Teacher
- type User
- func (u *User) CreateWithGoogle(ctx context.Context, name, email, googleID string) (*model2.User, *model2.UserGoogle, error)
- func (u *User) FindAllByEmailVerified(ctx context.Context, notificationInterval int) ([]*model2.User, error)
- func (u *User) FindByGoogleID(ctx context.Context, googleID string) (*model2.User, error)
- func (u *User) FindLoggedInUser(ctx context.Context, apiToken string) (*model2.User, error)
- func (u *User) IsDuplicateEmail(ctx context.Context, email string) (bool, error)
- func (u *User) IsValidEmail(email string) bool
- func (u *User) UpdateEmail(ctx context.Context, id uint, email string) error
- type UserAPIToken
Constants ¶
View Source
const MaxFollowTeacherCount = 20
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorRecorder ¶
type ErrorRecorder struct {
// contains filtered or unexported fields
}
func NewErrorRecorder ¶
func NewErrorRecorder(appLogger *zap.Logger, repo repository.ErrorRecorder) *ErrorRecorder
type FollowingTeacher ¶
type FollowingTeacher struct {
// contains filtered or unexported fields
}
func NewFollowingTeacher ¶
func NewFollowingTeacher( appLogger *zap.Logger, dbRepo repository.DB, followingTeacherRepo repository.FollowingTeacher, userRepo repository.User, teacherRepo repository.Teacher, lessonFetcherRepo repository.LessonFetcher, ) *FollowingTeacher
func (*FollowingTeacher) Create ¶
func (u *FollowingTeacher) Create(ctx context.Context, followingTeacher *model2.FollowingTeacher) error
func (*FollowingTeacher) DeleteFollowingTeachers ¶
func (*FollowingTeacher) FindTeachersByUserID ¶
func (*FollowingTeacher) FollowTeacher ¶
func (*FollowingTeacher) ReachesFollowingTeacherLimit ¶
type GAMeasurement ¶
type GAMeasurement struct {
// contains filtered or unexported fields
}
func NewGAMeasurement ¶
func NewGAMeasurement(gaMeasurementRepo repository.GAMeasurement) *GAMeasurement
type Lesson ¶
type Lesson struct {
// contains filtered or unexported fields
}
func NewLesson ¶
func NewLesson( lessonRepo repository.Lesson, lessonStatusLogRepo repository.LessonStatusLog, ) *Lesson
func (*Lesson) FindLessons ¶
func (*Lesson) GetNewAvailableLessons ¶
type LessonNotifier ¶
type LessonNotifier struct{}
func (*LessonNotifier) Close ¶
func (ln *LessonNotifier) Close(ctx context.Context, stat *model2.StatNotifier)
func (*LessonNotifier) SendNotification ¶
type Notification ¶
type Notification struct { }
func NewNotification ¶
func NewNotification() *Notification
func (*Notification) NewLessonNotifier ¶
func (n *Notification) NewLessonNotifier(lessonFetcher repository.LessonFetcher) *LessonNotifier
type NotificationTimeSpan ¶
type NotificationTimeSpan struct {
// contains filtered or unexported fields
}
func NewNotificationTimeSpan ¶
func NewNotificationTimeSpan(notificationTimeSpanRepo repository.NotificationTimeSpan) *NotificationTimeSpan
func (*NotificationTimeSpan) FindByUserID ¶
func (u *NotificationTimeSpan) FindByUserID(ctx context.Context, userID uint) ([]*model2.NotificationTimeSpan, error)
func (*NotificationTimeSpan) UpdateAll ¶
func (u *NotificationTimeSpan) UpdateAll(ctx context.Context, userID uint, timeSpans []*model2.NotificationTimeSpan) error
type Notifier ¶
func NewNotifier ¶
func NewNotifier( appLogger *zap.Logger, db *gorm.DB, errorRecorder *ErrorRecorder, fetcher repository.LessonFetcher, dryRun bool, lessonUsecase *Lesson, notificationTimeSpanUsecase *NotificationTimeSpan, statNotifierUsecase *StatNotifier, teacherUsecase *Teacher, sender repository.EmailSender, followingTeacherRepo repository.FollowingTeacher, ) *Notifier
type StatNotifier ¶
type StatNotifier struct {
// contains filtered or unexported fields
}
func NewStatNotifier ¶
func NewStatNotifier(statNotifierRepo repository.StatNotifier) *StatNotifier
func (*StatNotifier) CreateOrUpdate ¶
func (u *StatNotifier) CreateOrUpdate(ctx context.Context, statNotifier *model2.StatNotifier) error
type Teacher ¶
type Teacher struct {
// contains filtered or unexported fields
}
func NewTeacher ¶
func NewTeacher(teacherRepo repository.Teacher) *Teacher
func (*Teacher) CreateOrUpdate ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func NewUser ¶
func NewUser(dbRepo repository.DB, userRepo repository.User, userGoogleRepo repository.UserGoogle) *User
func (*User) CreateWithGoogle ¶
func (*User) FindAllByEmailVerified ¶
func (*User) FindByGoogleID ¶
func (*User) FindLoggedInUser ¶
func (*User) IsDuplicateEmail ¶
func (*User) IsValidEmail ¶
type UserAPIToken ¶
type UserAPIToken struct {
// contains filtered or unexported fields
}
func NewUserAPIToken ¶
func NewUserAPIToken(userAPITokenRepo repository.UserAPIToken) *UserAPIToken
func (*UserAPIToken) Create ¶
func (u *UserAPIToken) Create(ctx context.Context, userID uint) (*model2.UserAPIToken, error)
func (*UserAPIToken) DeleteByUserIDAndToken ¶
Click to show internal directories.
Click to hide internal directories.