Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card interface { GetDeck() Deck GetDomain() domain.Card GetWord() string ChangeWord(newWord string) error GetTranslation() string ChangeTranslation(newTranslation string) error PutInDeck(deck Deck) error Delete() error }
Card describes flashcard, stored in some deck.
type Deck ¶
type Deck interface { GetDomain() domain.Deck GetName() string Rename(newName string) error ListAllCards() ([]Card, error) FilterCards(filterFunc func(domain.Card) bool) ([]Card, error) FindCards(word, translation string) ([]Card, error) FindCardsByWord(word string) ([]Card, error) AddCard(word, translation string) (Card, error) Clear() error }
Deck is an interface that describes all opertions that deck of flashcards can do.
type DeckManager ¶
type DeckManager interface { ListAllDecks() ([]Deck, error) CreateDeck(name string) (Deck, error) FindDeckByName(name string) (Deck, error) FilterDecks(filterFunc func(domain.Deck) bool) ([]Deck, error) DeleteDeckByName(name string) error }
DeckManager is an interface that describes deck management.
func NewManager ¶ added in v0.3.1
func NewManager(storage storage.Storage) DeckManager
NewManager creates new deckManager with passed storage.
func NewManagerWithService ¶ added in v0.3.1
func NewManagerWithService(service service.FlashcardService) DeckManager
NewManagerWithService creates new deckManager with passed service.
Click to show internal directories.
Click to hide internal directories.