Documentation ¶
Index ¶
- Variables
- type Storage
- func (d *Storage) AppendBacksides(ctx context.Context, cardId models.FlashcardId, backsides []models.Backside) error
- func (d *Storage) DeleteFlashcardFromDeck(ctx context.Context, cardId models.FlashcardId) error
- func (d *Storage) DeleteLeitner(ctx context.Context, id models.LeitnerId) error
- func (d *Storage) DeleteUserDeck(ctx context.Context, userId models.UserId, deckId models.DeckId) error
- func (d *Storage) GetDecksByUserId(ctx context.Context, id models.UserId) (models.Decks, error)
- func (d *Storage) GetFlashcardById(ctx context.Context, id models.FlashcardId) (models.Flashcard, error)
- func (d *Storage) GetFlashcardsIdByDeckId(ctx context.Context, id models.DeckId) ([]models.FlashcardId, error)
- func (d *Storage) GetLeitnerByUserIdCardId(ctx context.Context, id models.UserId, flashcardId models.FlashcardId) (models.UserLeitner, error)
- func (d *Storage) GetRandomCardDeckN(ctx context.Context, userId models.UserId, deckId models.DeckId, ...) ([]models.FlashcardId, error)
- func (d *Storage) GetRandomCardN(ctx context.Context, userId models.UserId, down models.CoolDown, n int) ([]models.FlashcardId, error)
- func (d *Storage) GetUserInfo(ctx context.Context, uid models.UserId) (models.UserInfo, error)
- func (d *Storage) PutAllFlashcards(ctx context.Context, id models.DeckId, cards []models.Flashcard) ([]models.FlashcardId, error)
- func (d *Storage) PutAllUserLeitner(ctx context.Context, uls []models.UserLeitner) ([]models.LeitnerId, error)
- func (d *Storage) PutNewDeck(ctx context.Context, config models.DeckConfig) (models.DeckId, error)
- func (d *Storage) UpdateDeck(ctx context.Context, deck models.DeckConfig) error
- func (d *Storage) UpdateFlashcard(ctx context.Context, id models.FlashcardId, w models.Word, b models.Backside, ...) error
- func (d *Storage) UpdateLeitner(ctx context.Context, ul models.UserLeitner) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCardsNotFound = errors.New("cards not found")
View Source
var ErrNotOwner = fmt.Errorf("user is not owner of the flashcard")
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
Conn *db.PSQLDatabase
}
func (*Storage) AppendBacksides ¶
func (*Storage) DeleteFlashcardFromDeck ¶
func (*Storage) DeleteLeitner ¶
func (*Storage) DeleteUserDeck ¶
func (*Storage) GetDecksByUserId ¶
func (*Storage) GetFlashcardById ¶
func (*Storage) GetFlashcardsIdByDeckId ¶
func (*Storage) GetLeitnerByUserIdCardId ¶
func (d *Storage) GetLeitnerByUserIdCardId(ctx context.Context, id models.UserId, flashcardId models.FlashcardId) (models.UserLeitner, error)
func (*Storage) GetRandomCardDeckN ¶
func (*Storage) GetRandomCardN ¶
func (*Storage) GetUserInfo ¶
func (*Storage) PutAllFlashcards ¶
func (*Storage) PutAllUserLeitner ¶
func (*Storage) PutNewDeck ¶
func (*Storage) UpdateDeck ¶
func (*Storage) UpdateFlashcard ¶
func (*Storage) UpdateLeitner ¶
Click to show internal directories.
Click to hide internal directories.