deck

package
v0.0.0-...-e3cadf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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 (d *Storage) AppendBacksides(ctx context.Context,
	cardId models.FlashcardId,
	backsides []models.Backside,
) error

func (*Storage) DeleteFlashcardFromDeck

func (d *Storage) DeleteFlashcardFromDeck(ctx context.Context, cardId models.FlashcardId) error

func (*Storage) DeleteLeitner

func (d *Storage) DeleteLeitner(ctx context.Context, id models.LeitnerId) error

func (*Storage) DeleteUserDeck

func (d *Storage) DeleteUserDeck(ctx context.Context, userId models.UserId, deckId models.DeckId) error

func (*Storage) GetDecksByUserId

func (d *Storage) GetDecksByUserId(ctx context.Context, id models.UserId) (models.Decks, error)

func (*Storage) GetFlashcardById

func (d *Storage) GetFlashcardById(ctx context.Context, id models.FlashcardId) (models.Flashcard, error)

func (*Storage) GetFlashcardsIdByDeckId

func (d *Storage) GetFlashcardsIdByDeckId(ctx context.Context, id models.DeckId) ([]models.FlashcardId, error)

func (*Storage) GetLeitnerByUserIdCardId

func (d *Storage) GetLeitnerByUserIdCardId(ctx context.Context, id models.UserId, flashcardId models.FlashcardId) (models.UserLeitner, error)

func (*Storage) GetRandomCardDeckN

func (d *Storage) GetRandomCardDeckN(ctx context.Context, userId models.UserId, deckId models.DeckId, down models.CoolDown, n int) ([]models.FlashcardId, error)

func (*Storage) GetRandomCardN

func (d *Storage) GetRandomCardN(ctx context.Context, userId models.UserId, down models.CoolDown, n int) ([]models.FlashcardId, error)

func (*Storage) GetUserInfo

func (d *Storage) GetUserInfo(ctx context.Context, uid models.UserId) (models.UserInfo, error)

func (*Storage) PutAllFlashcards

func (d *Storage) PutAllFlashcards(ctx context.Context, id models.DeckId, cards []models.Flashcard) ([]models.FlashcardId, error)

func (*Storage) PutAllUserLeitner

func (d *Storage) PutAllUserLeitner(ctx context.Context, uls []models.UserLeitner) ([]models.LeitnerId, error)

func (*Storage) PutNewDeck

func (d *Storage) PutNewDeck(ctx context.Context, config models.DeckConfig) (models.DeckId, error)

func (*Storage) UpdateDeck

func (d *Storage) UpdateDeck(ctx context.Context, deck models.DeckConfig) error

func (*Storage) UpdateFlashcard

func (d *Storage) UpdateFlashcard(ctx context.Context,
	id models.FlashcardId,
	w models.Word,
	b models.Backside,
	a models.Answer) error

func (*Storage) UpdateLeitner

func (d *Storage) UpdateLeitner(ctx context.Context, ul models.UserLeitner) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL