Documentation
¶
Overview ¶
Package models provides entities for the flashcards services
Package models describes models for application.
Documentation for MADR API.
Schemes: http BasePath: / Version: 0.0.1 Contact: Artyom Blaginin<pelageech@mail.ru>
Consumes: - application/json
Produces: - application/json
swagger:meta
Index ¶
- Constants
- func ParseBackside(b Backside) string
- type AddFlashcardToDeckRequest
- type AddFlashcardToDeckResponse
- type Answer
- type AppendBacksideRequest
- type AppendBacksideResponse
- type Backside
- type BacksideType
- type Box
- type CoolDown
- type DeckConfig
- type DeckId
- type Decks
- type DeleteDeckRequest
- type DeleteDeckResponse
- type DeleteFlashcardFromDeckRequest
- type DeleteFlashcardFromDeckResponse
- type Flashcard
- type FlashcardId
- type GetFlashcardByIdResponse
- type GetFlashcardsByDeckIdRequest
- type GetFlashcardsByDeckIdResponse
- type LeitnerId
- type LoadDecksRequest
- type LoadDecksResponse
- type Mark
- type Matching
- type NewDeckWithFlashcardsRequest
- type NewDeckWithFlashcardsResponse
- type RandomCardDeckRequest
- type RandomCardDeckResponse
- type RandomCardRequest
- type RandomCardResponse
- type RandomMatchingDeckRequest
- type RandomMatchingDeckResponse
- type RandomMatchingRequest
- type RandomMatchingResponse
- type RandomNCardsDeckRequest
- type RandomNCardsDeckResponse
- type RandomNCardsRequest
- type RandomNCardsResponse
- type RandomTextDeckRequest
- type RandomTextDeckResponse
- type RandomTextRequest
- type RandomTextResponse
- type RateRequest
- type RateResponse
- type SwaggerAddFlashcardToDeckBadRequestError
- type SwaggerAddFlashcardToDeckCreatedResponse
- type SwaggerAddFlashcardToDeckInternalServerError
- type SwaggerDeleteDeckBadRequestError
- type SwaggerDeleteDeckInternalServerError
- type SwaggerDeleteDeckNoContentResponse
- type SwaggerDeleteFlashcardFromDeckBadRequestError
- type SwaggerDeleteFlashcardFromDeckInternalServerError
- type SwaggerDeleteFlashcardFromDeckNoContentResponse
- type SwaggerGetFlashcardByIdBadRequest
- type SwaggerGetFlashcardByIdInternalServerError
- type SwaggerGetFlashcardByIdOkResponse
- type SwaggerGetFlashcardsByDeckIdBadRequestError
- type SwaggerGetFlashcardsByDeckIdInternalServerError
- type SwaggerGetFlashcardsByDeckIdOkResponse
- type SwaggerLoadDecksBadRequestError
- type SwaggerLoadDecksInternalServerError
- type SwaggerLoadDecksOkResponse
- type SwaggerNewDeckWithFlashcardsBadRequestError
- type SwaggerNewDeckWithFlashcardsInternalServerError
- type SwaggerNewDeckWithFlashcardsNoContentResponse
- type SwaggerRandomCardBadRequest
- type SwaggerRandomCardDeckBadRequest
- type SwaggerRandomCardDeckInternalServerError
- type SwaggerRandomCardDeckOkResponse
- type SwaggerRandomCardInternalServerError
- type SwaggerRandomCardOkResponse
- type SwaggerRandomMatchingBadRequest
- type SwaggerRandomMatchingDeckBadRequest
- type SwaggerRandomMatchingDeckInternalServerError
- type SwaggerRandomMatchingDeckOkResponse
- type SwaggerRandomMatchingInternalServerError
- type SwaggerRandomMatchingOkResponse
- type SwaggerRandomNCardsBadRequest
- type SwaggerRandomNCardsDeckBadRequest
- type SwaggerRandomNCardsDeckInternalServerError
- type SwaggerRandomNCardsDeckOkResponse
- type SwaggerRandomNCardsInternalServerError
- type SwaggerRandomNCardsOkResponse
- type SwaggerRandomTextBadRequest
- type SwaggerRandomTextDeckBadRequest
- type SwaggerRandomTextDeckInternalServerError
- type SwaggerRandomTextDeckOkResponse
- type SwaggerRandomTextInternalServerError
- type SwaggerRandomTextOkResponse
- type SwaggerRateBadRequest
- type SwaggerRateInternalServerError
- type SwaggerRateNoContentResponse
- type Text
- type UserId
- type UserInfo
- type UserLeitner
- type Word
Constants ¶
const ( Translation = BacksideType(iota) Definition )
Variables ¶
This section is empty.
Functions ¶
func ParseBackside ¶
ParseBackside returns a new string from value of backside if needed.
For example, from base64 to another string.
Types ¶
type AddFlashcardToDeckRequest ¶
type AddFlashcardToDeckRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // DeckId is an ID of the deck which the flashcard will be added to. // // required: true // example: 123 DeckId DeckId `json:"deck_id"` // Word is a head side of the card. // // required: true // example: Aboba Word Word `json:"word"` // Backside is a back side of the card. // // required: true // example: Backside{Type: TypeDefinition, Value: "President"} Backside Backside `json:"backside"` // Answer is an answer for exercises. // // required: true // example: "aboba" Answer Answer `json:"answer"` }
AddFlashcardToDeckRequest is a struct that defines the request body for adding cards to the deck handler.
type AddFlashcardToDeckResponse ¶
type AddFlashcardToDeckResponse struct{}
AddFlashcardToDeckResponse is a struct that defines the response body for adding cards to the deck handler.
type AppendBacksideRequest ¶
type AppendBacksideRequest struct { UserId UserId `json:"user_id"` CardId FlashcardId `json:"card_id"` Backsides []Backside `json:"backsides"` }
type AppendBacksideResponse ¶
type AppendBacksideResponse struct{}
type Backside ¶
type Backside struct { Type BacksideType `json:"type"` Value string `json:"value"` }
Backside is an abstract type for representation an answer of describing the Word. That can be just a string (translation, definition) or image, or sound - everything depends on Answer method.
type CoolDown ¶
CoolDown describes the timestamp. If the current time is less than the CoolDown state, the flashcard will not be shown for study.
func (*CoolDown) IsPassedNow ¶
IsPassedNow returns true if state of CoolDown is not less than time.Now.
type DeckConfig ¶
type DeckConfig struct { // DeckId is a unique identifier of the deck. // // required: true // example: 1 DeckId DeckId `json:"deck_id"` // UserId means that a user with UserId has the deck with id DeckId. // // required: true // example: 12 UserId UserId `json:"user_id"` // Name is a name of the deck which the user assigned to it. // // required: true // example: Bangladesh famous words Name string `json:"name"` }
DeckConfig contains information about a particular deck. DeckId is not a primary key, for each user a configuration can be different.
type Decks ¶
type Decks map[DeckId]DeckConfig
Decks is a map of decks which config can be got by id.
func (Decks) Values ¶
func (d Decks) Values() []DeckConfig
type DeleteDeckRequest ¶
type DeleteDeckRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // DeckId is an ID of the deck which will be deleted. // // required: true // example: 123 DeckId DeckId `json:"deck_id"` }
DeleteDeckRequest is a struct that defines the request body for the deleting the deck handler.
type DeleteDeckResponse ¶
type DeleteDeckResponse struct{}
DeleteDeckResponse is a struct that defines the response body for the deleting the deck handler.
type DeleteFlashcardFromDeckRequest ¶
type DeleteFlashcardFromDeckRequest struct { // UserId is an ID of the user. // // required: true // example: 189 UserId UserId `json:"user_id"` // FlashcardId is an ID of the flashcard. // // required: true // example: 666 FlashcardId FlashcardId `json:"flashcard_id"` }
DeleteFlashcardFromDeckRequest is a struct that defines the request body for deleting cards from the deck handler.
type DeleteFlashcardFromDeckResponse ¶
type DeleteFlashcardFromDeckResponse struct{}
DeleteFlashcardFromDeckResponse is a struct that defines the response body for deleting cards from the deck handler.
type Flashcard ¶
type Flashcard struct { Id FlashcardId `json:"id"` W Word `json:"word"` A Answer `json:"answer"` B Backside `json:"backside"` MB []Backside `json:"multiple_backside"` // DeckId shows which deck the flashcard belongs to. DeckId DeckId `json:"deck_id"` }
Flashcard is a model of real flashcards with front side with word and back side containing some information that describes a word.
type FlashcardId ¶
type FlashcardId = int
type GetFlashcardByIdResponse ¶
type GetFlashcardByIdResponse struct {
Flashcard Flashcard `json:"flashcard"`
}
GetFlashcardByIdResponse is a response that contains a flashcard.
type GetFlashcardsByDeckIdRequest ¶
type GetFlashcardsByDeckIdRequest struct { // DeckId defines the deck which flashcards will be loaded from. // // required: true // example: 123 DeckId DeckId `json:"deck_id"` }
GetFlashcardsByDeckIdRequest is a struct that defines the request body for loading cards from the deck handler.
type GetFlashcardsByDeckIdResponse ¶
type GetFlashcardsByDeckIdResponse struct { // Flashcards is a slice of flashcards that is returned to the client. // // Extensions: // --- // x-property-value: value // x-property-array: // - value1 // - value2 // x-property-array-obj: // - name: obj // value: field // --- Flashcards []Flashcard `json:"flashcards"` }
GetFlashcardsByDeckIdResponse is a struct that defines the response body for loading cards from the deck handler.
type LoadDecksRequest ¶
type LoadDecksRequest struct { // UserId is used for loading for the cards that the user has. // // required: true // example: 189 UserId UserId `json:"user_id"` }
LoadDecksRequest is a struct that defines the request body for loading deck handler.
type LoadDecksResponse ¶
type LoadDecksResponse struct { // Decks is a slice of deck with their configs. // // Extensions: // --- // x-property-value: value // x-property-array: // - value1 // - value2 // x-property-array-obj: // - name: obj // value: field // --- Decks []DeckConfig `json:"decks"` }
LoadDecksResponse is a struct that defines the response body for loading deck handler.
type Matching ¶
type Matching struct { M map[string]string `json:"pairs"` Cards map[string]Flashcard `json:"cards"` }
Matching is used for exercises connected with matching words with their definitions or other answers.
type NewDeckWithFlashcardsRequest ¶
type NewDeckWithFlashcardsRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // Name is a name of the deck // // required: true // example: Aboba123 Name string `json:"name"` // Flashcards is a slice of flashcards that will be added. // // Extensions: // --- // x-property-value: value // x-property-array: // - value1 // - value2 // x-property-array-obj: // - name: obj // value: field // --- Flashcards []struct { Word Word `json:"word"` Backside Backside `json:"backside"` Answer Answer `json:"answer"` } `json:"flashcards"` }
NewDeckWithFlashcardsRequest is a struct that defines the request body for creating a new deck handler.
type NewDeckWithFlashcardsResponse ¶
type NewDeckWithFlashcardsResponse struct{}
NewDeckWithFlashcardsResponse is a struct that defines the response body for creating a new deck handler.
type RandomCardDeckRequest ¶
type RandomCardDeckRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // DeckId is an ID of the deck where the flashcard are taken from. // // required: true // example: 123 DeckId DeckId `json:"deck_id"` }
RandomCardDeckRequest is a struct that defines the request body for the getting a random card from the deck.
type RandomCardDeckResponse ¶
type RandomCardDeckResponse struct { // Flashcard is a flashcard that is returned to the user. Flashcard Flashcard `json:"flashcard"` }
RandomCardDeckResponse is a struct that defines the response body for getting a random card from the deck.
type RandomCardRequest ¶
type RandomCardRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` }
RandomCardRequest is a struct that defines the request body for getting a random card from all the decks.
type RandomCardResponse ¶
type RandomCardResponse struct { // Flashcard is a flashcard that is returned to the user. Flashcard Flashcard `json:"flashcard"` }
RandomCardResponse is a struct that defines the response body for getting a random card from all the decks.
type RandomMatchingDeckRequest ¶
type RandomMatchingDeckRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // DeckId is an ID of the deck where the flashcard are taken from. // // required: true // example: 123 DeckId DeckId `json:"deck_id"` // Size is the max amount of cards to include int the exercise // // required: true // example: 5 Size int `json:"size"` }
RandomMatchingDeckRequest is a struct that defines the request body for getting a random matching exercise from the deck.
type RandomMatchingDeckResponse ¶
type RandomMatchingDeckResponse struct {
Matching Matching `json:"matching"`
}
RandomMatchingDeckRequest is a struct that defines the request body for getting a random matching from the deck.
type RandomMatchingRequest ¶
type RandomMatchingRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // Size is the max amount of cards to include int the exercise // // required: true // example: 5 Size int `json:"size"` }
RandomMatchingRequest is a struct that defines the request body for getting a random matching exercise from all the decks.
type RandomMatchingResponse ¶
type RandomMatchingResponse struct {
Matching Matching `json:"matching"`
}
RandomMatchingRequest is a struct that defines the request body for getting a random matching from all the decks.
type RandomNCardsDeckRequest ¶
type RandomNCardsDeckRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // DeckId is an ID of the deck where the flashcard are taken from. // // required: true // example: 123 DeckId DeckId `json:"deck_id"` // Amount of cards to get N int `json:"n"` }
RandomNCardsDeckRequest is a struct that defines the request body for getting n random cards from the deck.
type RandomNCardsDeckResponse ¶
type RandomNCardsDeckResponse struct { // Flashcard is a flashcard that is returned to the user. Flashcards []Flashcard `json:"flashcards"` }
RandomNCardsDeckResponse is a struct that defines the response body for getting n random cards from the deck.
type RandomNCardsRequest ¶
type RandomNCardsRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // Amount of cards to get N int `json:"n"` }
RandomNCardsRequest is a struct that defines the request body for getting n random cards from all the decks.
type RandomNCardsResponse ¶
type RandomNCardsResponse struct { // Flashcard is a flashcard that is returned to the user. Flashcards []Flashcard `json:"flashcards"` }
RandomNCardsResponse is a struct that defines the response body for getting n random cards from all the decks.
type RandomTextDeckRequest ¶
type RandomTextDeckRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // DeckId is an ID of the deck where the flashcard are taken from. // // required: true // example: 123 DeckId DeckId `json:"deck_id"` // Size is the max amount of cards to include int the exercise // // required: true // example: 5 Size int `json:"size"` }
RandomTextDeckRequest is a struct that defines the request body for getting a random text exercise from all the decks.
type RandomTextDeckResponse ¶
type RandomTextDeckResponse struct {
Text Text `json:"text"`
}
RandomTextDeckResponse is a struct that defines the response body for getting a random text exercise from all the decks.
type RandomTextRequest ¶
type RandomTextRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // Size is the max amount of cards to include int the exercise // // required: true // example: 5 Size int `json:"size"` }
RandomTextRequest is a struct that defines the request body for getting a random text exercise from all the decks.
type RandomTextResponse ¶
type RandomTextResponse struct {
Text Text `json:"text"`
}
RandomTextResponse is a struct that defines the response body for getting a random text exercise from all the decks.
type RateRequest ¶
type RateRequest struct { // UserId is an ID of the user in a storage. // // required: true // example: 189 UserId UserId `json:"user_id"` // FlashcardId is an ID of the flashcard. // // required: true // example: 1111 FlashcardId FlashcardId `json:"flashcard_id"` // Mark is a mark for the card. // // required: true // example: 0, 1 or 2 Mark Mark `json:"mark"` }
RateRequest is a struct that defines the request body for the rating a card.
type RateResponse ¶
type RateResponse struct{}
RateResponse is a struct that defines the request body for the rating a card.
type SwaggerAddFlashcardToDeckBadRequestError ¶
type SwaggerAddFlashcardToDeckBadRequestError struct { // in: body Body ioutil.GenericError }
swagger:response addFlashcardToDeckBadRequestError
type SwaggerAddFlashcardToDeckCreatedResponse ¶
type SwaggerAddFlashcardToDeckCreatedResponse struct{}
swagger:response addFlashcardToDeckCreatedResponse
type SwaggerAddFlashcardToDeckInternalServerError ¶
type SwaggerAddFlashcardToDeckInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response addFlashcardToDeckInternalServerError
type SwaggerDeleteDeckBadRequestError ¶
type SwaggerDeleteDeckBadRequestError struct { // in: body Body ioutil.GenericError }
swagger:response deleteDeckBadRequestError
type SwaggerDeleteDeckInternalServerError ¶
type SwaggerDeleteDeckInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response deleteDeckInternalServerError
type SwaggerDeleteDeckNoContentResponse ¶
type SwaggerDeleteDeckNoContentResponse struct{}
swagger:response deleteDeckNoContentResponse
type SwaggerDeleteFlashcardFromDeckBadRequestError ¶
type SwaggerDeleteFlashcardFromDeckBadRequestError struct { // in: body Body ioutil.GenericError }
swagger:response deleteFlashcardFromDeckBadRequestError
type SwaggerDeleteFlashcardFromDeckInternalServerError ¶
type SwaggerDeleteFlashcardFromDeckInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response deleteFlashcardFromDeckInternalServerError
type SwaggerDeleteFlashcardFromDeckNoContentResponse ¶
type SwaggerDeleteFlashcardFromDeckNoContentResponse struct{}
swagger:response deleteFlashcardFromDeckNoContentResponse
type SwaggerGetFlashcardByIdBadRequest ¶
type SwaggerGetFlashcardByIdBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response getFlashcardByIdBadRequestError
type SwaggerGetFlashcardByIdInternalServerError ¶
type SwaggerGetFlashcardByIdInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response getFlashcardByIdInternalServerError
type SwaggerGetFlashcardByIdOkResponse ¶
type SwaggerGetFlashcardByIdOkResponse struct { // in: body Body GetFlashcardByIdResponse }
swagger:response getFlashcardByIdOKResponse
type SwaggerGetFlashcardsByDeckIdBadRequestError ¶
type SwaggerGetFlashcardsByDeckIdBadRequestError struct { // in: body Body ioutil.GenericError }
swagger:response getFlashcardsByDeckIdBadRequestError
type SwaggerGetFlashcardsByDeckIdInternalServerError ¶
type SwaggerGetFlashcardsByDeckIdInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response getFlashcardsByDeckIdInternalServerError
type SwaggerGetFlashcardsByDeckIdOkResponse ¶
type SwaggerGetFlashcardsByDeckIdOkResponse struct { // in: body Body GetFlashcardsByDeckIdResponse }
swagger:response getFlashcardsByDeckIdOkResponse
type SwaggerLoadDecksBadRequestError ¶
type SwaggerLoadDecksBadRequestError struct { // in: body Body ioutil.GenericError }
swagger:response loadDecksBadRequestError
type SwaggerLoadDecksInternalServerError ¶
type SwaggerLoadDecksInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response loadDecksInternalServerError
type SwaggerLoadDecksOkResponse ¶
type SwaggerLoadDecksOkResponse struct { // in: body Body LoadDecksResponse }
swagger:response loadDecksOkResponse
type SwaggerNewDeckWithFlashcardsBadRequestError ¶
type SwaggerNewDeckWithFlashcardsBadRequestError struct { // in: body Body ioutil.GenericError }
swagger:response newDeckWithFlashcardsBadRequestError
type SwaggerNewDeckWithFlashcardsInternalServerError ¶
type SwaggerNewDeckWithFlashcardsInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response newDeckWithFlashcardsInternalServerError
type SwaggerNewDeckWithFlashcardsNoContentResponse ¶
type SwaggerNewDeckWithFlashcardsNoContentResponse struct{}
swagger:response newDeckWithFlashcardsCreatedResponse
type SwaggerRandomCardBadRequest ¶
type SwaggerRandomCardBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomCardBadRequestError
type SwaggerRandomCardDeckBadRequest ¶
type SwaggerRandomCardDeckBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomCardDeckBadRequestError
type SwaggerRandomCardDeckInternalServerError ¶
type SwaggerRandomCardDeckInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomCardDeckInternalServerError
type SwaggerRandomCardDeckOkResponse ¶
type SwaggerRandomCardDeckOkResponse struct { // in: body Body RandomCardDeckResponse }
swagger:response randomCardDeckOkResponse
type SwaggerRandomCardInternalServerError ¶
type SwaggerRandomCardInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomCardInternalServerError
type SwaggerRandomCardOkResponse ¶
type SwaggerRandomCardOkResponse struct { // in: body Body RandomCardResponse }
swagger:response randomCardOkResponse
type SwaggerRandomMatchingBadRequest ¶
type SwaggerRandomMatchingBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomMatchingBadRequestError
type SwaggerRandomMatchingDeckBadRequest ¶
type SwaggerRandomMatchingDeckBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomMatchingDeckBadRequestError
type SwaggerRandomMatchingDeckInternalServerError ¶
type SwaggerRandomMatchingDeckInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomMatchingDeckInternalServerError
type SwaggerRandomMatchingDeckOkResponse ¶
type SwaggerRandomMatchingDeckOkResponse struct { // in: body Body RandomMatchingDeckResponse }
swagger:response randomMatchingDeckOkResponse
type SwaggerRandomMatchingInternalServerError ¶
type SwaggerRandomMatchingInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomMatchingInternalServerError
type SwaggerRandomMatchingOkResponse ¶
type SwaggerRandomMatchingOkResponse struct { // in: body Body RandomMatchingResponse }
swagger:response randomMatchingOkResponse
type SwaggerRandomNCardsBadRequest ¶
type SwaggerRandomNCardsBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomNCardsBadRequestError
type SwaggerRandomNCardsDeckBadRequest ¶
type SwaggerRandomNCardsDeckBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomNCardsDeckBadRequestError
type SwaggerRandomNCardsDeckInternalServerError ¶
type SwaggerRandomNCardsDeckInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomNCardsDeckInternalServerError
type SwaggerRandomNCardsDeckOkResponse ¶
type SwaggerRandomNCardsDeckOkResponse struct { // in: body Body RandomNCardsDeckResponse }
swagger:response randomNCardsDeckOkResponse
type SwaggerRandomNCardsInternalServerError ¶
type SwaggerRandomNCardsInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomNCardsInternalServerError
type SwaggerRandomNCardsOkResponse ¶
type SwaggerRandomNCardsOkResponse struct { // in: body Body RandomNCardsResponse }
swagger:response randomNCardsOkResponse
type SwaggerRandomTextBadRequest ¶
type SwaggerRandomTextBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomTextBadRequestError
type SwaggerRandomTextDeckBadRequest ¶
type SwaggerRandomTextDeckBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response randomTextDeckBadRequestError
type SwaggerRandomTextDeckInternalServerError ¶
type SwaggerRandomTextDeckInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomTextDeckInternalServerError
type SwaggerRandomTextDeckOkResponse ¶
type SwaggerRandomTextDeckOkResponse struct { // in: body Body RandomTextDeckResponse }
swagger:response randomTextDeckOkResponse
type SwaggerRandomTextInternalServerError ¶
type SwaggerRandomTextInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response randomTextInternalServerError
type SwaggerRandomTextOkResponse ¶
type SwaggerRandomTextOkResponse struct { // in: body Body RandomTextResponse }
swagger:response randomTextOkResponse
type SwaggerRateBadRequest ¶
type SwaggerRateBadRequest struct { // in: body Body ioutil.GenericError }
swagger:response rateBadRequestError
type SwaggerRateInternalServerError ¶
type SwaggerRateInternalServerError struct { // in: body Body ioutil.GenericError }
swagger:response rateInternalServerError
type SwaggerRateNoContentResponse ¶
type SwaggerRateNoContentResponse struct{}
swagger:response rateNoContentResponse
type Text ¶
type Text struct { // The words to guess are escaped like this: <div style=\"display:none;\"> WORD </div> T string `json:"text"` // Options for filling the spaces Opts []string `json:"options"` Cards map[string]Flashcard `json:"cards"` }
Text is used for exercises connected with insertion words in a sentence.
type UserInfo ¶
type UserInfo struct { UserId UserId `json:"user_id"` // primary // MaxBox is a maximal amount of boxes in Leitner's system. MaxBox Box `json:"max_box"` }
UserInfo contains information about the user.
type UserLeitner ¶
type UserLeitner struct { Id LeitnerId `json:"id"` // primary UserId UserId `json:"user_id"` FlashcardId FlashcardId `json:"card_id"` // Box is an item in Leitner's system showing frequency // of studying flashcards. The higher box, the more cool down. Box Box `json:"box"` // CoolDown is a timestamp showing when the flashcard will be ready // to be examined. CoolDown CoolDown `json:"cool_down"` }
UserLeitner is a configuration of Leitner's system for each user.
For each user the structure contains a FlashcardId with its Box and CoolDown. CoolDown is a timestamp after which the card can be examined again.
There is a bijection between (UserId, FlashcardId) and UserLeitner.