Documentation
¶
Index ¶
- type Client
- type Repository
- func (r *Repository) AddToLearningBatch(ctx context.Context, chatID int64, word string) error
- func (r *Repository) AddWordTranslation(ctx context.Context, chatID int64, word, translation, description string) error
- func (r *Repository) ConfirmAuthConfirmation(ctx context.Context, chatID int64, token string) error
- func (r *Repository) DeleteAuthConfirmation(ctx context.Context, chatID int64, token string) error
- func (r *Repository) DeleteFromLearningBatchGtGuessedStreak(ctx context.Context, chatID int64, guessedStreakLimit int) (int, error)
- func (r *Repository) DeleteWordTranslation(ctx context.Context, chatID int64, word string) error
- func (r *Repository) FindCallback(ctx context.Context, chatID int64, uuid string) (*dal.CallbackData, error)
- func (r *Repository) FindRandomWordTranslation(ctx context.Context, chatID int64, filter dal.FindRandomWordFilter) (*dal.WordTranslation, error)
- func (r *Repository) FindWordTranslation(ctx context.Context, chatID int64, word string) (*dal.WordTranslation, error)
- func (r *Repository) FindWordTranslations(ctx context.Context, chatID int64, filter dal.WordTranslationsFilter) ([]dal.WordTranslation, int, error)
- func (r *Repository) GetBatchedWordTranslationsCount(ctx context.Context, chatID int64) (int, error)
- func (r *Repository) GetStats(ctx context.Context, chatID int64, date time.Time) (*dal.Stats, error)
- func (r *Repository) GetStatsRange(ctx context.Context, chatID int64, from, to time.Time) ([]dal.Stats, error)
- func (r *Repository) GetTotalStats(ctx context.Context, chatID int64) (*dal.TotalStats, error)
- func (r *Repository) IncreaseGuessedStreak(ctx context.Context, chatID int64, word string) error
- func (r *Repository) IncrementWordGuessed(ctx context.Context, chatID int64) error
- func (r *Repository) IncrementWordMissed(ctx context.Context, chatID int64) error
- func (r *Repository) InsertAuthConfirmation(ctx context.Context, chatID int64, token string, expiresIn time.Duration) error
- func (r *Repository) InsertCallback(ctx context.Context, data dal.CallbackData) (string, error)
- func (r *Repository) IsConfirmed(ctx context.Context, chatID int64, token string) (bool, error)
- func (r *Repository) MarkToReview(ctx context.Context, chatID int64, word string, toReview bool) error
- func (r *Repository) ResetGuessedStreak(ctx context.Context, chatID int64, word string) error
- func (r *Repository) ResetToReview(ctx context.Context, chatID int64) error
- func (r *Repository) Transact(ctx context.Context, txFunc func(r dal.Repository) error) error
- func (r *Repository) UpdateTotalWordsLearned(ctx context.Context, chatID int64) error
- func (r *Repository) UpdateWordTranslation(ctx context.Context, chatID int64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Begin(ctx context.Context) (pgx.Tx, error) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func (*Repository) AddToLearningBatch ¶
func (*Repository) AddWordTranslation ¶
func (*Repository) ConfirmAuthConfirmation ¶
func (*Repository) DeleteAuthConfirmation ¶
func (*Repository) DeleteFromLearningBatchGtGuessedStreak ¶
func (*Repository) DeleteWordTranslation ¶
func (*Repository) FindCallback ¶
func (r *Repository) FindCallback(ctx context.Context, chatID int64, uuid string) (*dal.CallbackData, error)
func (*Repository) FindRandomWordTranslation ¶
func (r *Repository) FindRandomWordTranslation(ctx context.Context, chatID int64, filter dal.FindRandomWordFilter) (*dal.WordTranslation, error)
func (*Repository) FindWordTranslation ¶
func (r *Repository) FindWordTranslation(ctx context.Context, chatID int64, word string) (*dal.WordTranslation, error)
func (*Repository) FindWordTranslations ¶
func (r *Repository) FindWordTranslations(ctx context.Context, chatID int64, filter dal.WordTranslationsFilter) ([]dal.WordTranslation, int, error)
func (*Repository) GetBatchedWordTranslationsCount ¶
func (*Repository) GetStatsRange ¶
func (*Repository) GetTotalStats ¶
func (r *Repository) GetTotalStats(ctx context.Context, chatID int64) (*dal.TotalStats, error)
func (*Repository) IncreaseGuessedStreak ¶
func (*Repository) IncrementWordGuessed ¶
func (r *Repository) IncrementWordGuessed(ctx context.Context, chatID int64) error
func (*Repository) IncrementWordMissed ¶
func (r *Repository) IncrementWordMissed(ctx context.Context, chatID int64) error
func (*Repository) InsertAuthConfirmation ¶
func (*Repository) InsertCallback ¶
func (r *Repository) InsertCallback(ctx context.Context, data dal.CallbackData) (string, error)
func (*Repository) IsConfirmed ¶
func (*Repository) MarkToReview ¶
func (*Repository) ResetGuessedStreak ¶
func (*Repository) ResetToReview ¶
func (r *Repository) ResetToReview(ctx context.Context, chatID int64) error
func (*Repository) Transact ¶
func (r *Repository) Transact(ctx context.Context, txFunc func(r dal.Repository) error) error
func (*Repository) UpdateTotalWordsLearned ¶
func (r *Repository) UpdateTotalWordsLearned(ctx context.Context, chatID int64) error
func (*Repository) UpdateWordTranslation ¶
Click to show internal directories.
Click to hide internal directories.