flashcard

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 7 Imported by: 1

README

flashcard

Description

A Go package for flashcard mainipulation and learning.

⚡️ The project is in rapid stage of development, issues and critics are welcome.

Features

  • expressive API
  • sqlite as a storage; others can be added via implementation of storage.CardRepo and storage.DeckRepo interfaces

Table of contents

Getting started

See the documentation for further details.

Installation
go get github.com/k1gabyt0/flashcard
Usage

Documentation

Index

Constants

This section is empty.

Variables

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)
}

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.

Jump to

Keyboard shortcuts

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