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
GetValue() value.Card
Front() string
SetFront(val string) error
Back() string
SetBack(val string) error
Update(front, back string) error
PutInDeck(deck Deck) error
Delete() error
}
Card describes flashcard, stored in some deck.
type Deck ¶
type Deck interface {
GetValue() value.Deck
GetName() string
Rename(newName string) error
ListAllCards() ([]Card, error)
Count() (int, error)
FilterCards(filterFunc func(value.Card) bool) ([]Card, error)
FindCards(front, back string) ([]Card, error)
FindCardsByFront(front string) ([]Card, error)
AddCard(front, back string) (Card, error)
Clear() error
Delete() error
}
Deck is an interface that describes all opertions that deck of flashcards can do.
type DeckManager ¶
type DeckManager interface {
ListAllDecks() ([]Deck, error)
Count() (int, error)
CreateDeck(name string) (Deck, error)
FindDeckByName(name string) (Deck, error)
FilterDecks(filterFunc func(value.Deck) bool) ([]Deck, error)
GetDeckValidations() []valdy.Validation[value.Deck]
SetDeckValidations(validations ...valdy.Validation[value.Deck])
GetCardValidations() []valdy.Validation[value.Card]
SetCardValidations(validations ...valdy.Validation[value.Card])
}
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.