models

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 1 Imported by: 41

Documentation

Index

Constants

View Source
const (
	MEDIA       string = "media"
	AUTHORBASED string = "authorbased"
	DIALOGUE    string = "dialogue"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate added in v0.1.10

type Aggregate struct {
	HighestSet string `json:"highestSet"`
	Name       string `json:"name"`
}

type AggregateResult added in v0.1.10

type AggregateResult struct {
	Aggregates []Aggregate `json:"aggregates"`
}

type AnswerRequest added in v0.1.10

type AnswerRequest struct {
	Theme         string            `json:"theme"`
	Set           string            `json:"set"`
	QuizType      string            `json:"quizType"`
	Comprehensive bool              `json:"comprehensive,omitempty"`
	Answer        string            `json:"answer"`
	Dialogue      []DialogueContent `json:"dialogue,omitempty"`
	QuizWord      string            `json:"quizWord"`
}

type Author

type Author struct {
	// example: herodotos
	// required: true
	Author string `json:"author"`
}

swagger:model

func UnmarshalAuthors

func UnmarshalAuthors(data []byte) (Author, error)

func (*Author) Marshal

func (r *Author) Marshal() ([]byte, error)

type AuthorBasedContent added in v0.1.9

type AuthorBasedContent struct {
	Translation     string  `json:"translation"`
	TimesCorrect    int     `json:"timesCorrect,omitempty"`
	TimesIncorrect  int     `json:"timesIncorrect,omitempty"`
	AverageAccuracy float64 `json:"averageAccuracy,omitempty"`
	Greek           string  `json:"greek,omitempty"`
}

type AuthorBasedQuiz added in v0.1.9

type AuthorBasedQuiz struct {
	QuizMetadata struct {
		Language string `json:"language"`
	} `json:"quizMetadata"`
	QuizType string               `json:"quizType"`
	Theme    string               `json:"theme,omitempty"`
	Set      int                  `json:"set,omitempty"`
	Content  []AuthorBasedContent `json:"content"`
	Progress struct {
		TimesCorrect    int     `json:"timesCorrect"`
		TimesIncorrect  int     `json:"timesIncorrect"`
		AverageAccuracy float64 `json:"averageAccuracy"`
	} `json:"progress,omitempty"`
}

type Authors

type Authors struct {
	Authors []Author `json:"authors"`
}

swagger:model

type Biblos

type Biblos struct {
	Biblos []Meros `json:"biblos"`
}

func UnmarshalBiblos

func UnmarshalBiblos(data []byte) (Biblos, error)

func (*Biblos) Marshal

func (r *Biblos) Marshal() ([]byte, error)

type Book

type Book struct {
	// example: 2
	Book int64 `json:"book"`
}

swagger:model

type Books

type Books struct {
	Books []Book `json:"books"`
}

swagger:model

type CheckSentenceRequest

type CheckSentenceRequest struct {
	// example: fd4TlogBC__qOhD2dK31
	// required: true
	SentenceId string `json:"sentenceId"`
	// example: this is an example sentence
	// required: true
	ProvidedSentence string `json:"answerSentence"`
	// example: herodotos
	// required: true
	Author string `json:"author"`
}

swagger:model

func (*CheckSentenceRequest) Marshal

func (r *CheckSentenceRequest) Marshal() ([]byte, error)

type CheckSentenceResponse

type CheckSentenceResponse struct {
	// example: 9.09
	// required: true
	LevenshteinPercentage string `json:"levenshteinPercentage"`
	// example: Such a step would not be condemned either by the gods who received our oaths,
	// required: true
	QuizSentence string `json:"quizSentence"`
	// example: this is an example answer"
	// required: true
	AnswerSentence string `json:"answerSentence"`
	// example: ["Such", "condemned"]
	// required: true
	SplitQuizSentence []string `json:"splitQuizSentence"`
	// example: ["this", "example"]
	// required: true
	SplitAnswerSentence []string          `json:"splitAnswerSentence"`
	MatchingWords       []MatchingWord    `json:"matchingWords,omitempty"`
	NonMatchingWords    []NonMatchingWord `json:"nonMatchingWords,omitempty"`
}

swagger:model

type ComprehensiveResponse added in v0.1.10

type ComprehensiveResponse struct {
	Correct      bool    `json:"correct"`
	QuizWord     string  `json:"quizWord"`
	FoundInText  Rhema   `json:"foundInText,omitempty"`
	SimilarWords []Meros `json:"similarWords,omitempty"`
	Progress     struct {
		TimesCorrect    int     `json:"timesCorrect"`
		TimesIncorrect  int     `json:"timesIncorrect"`
		AverageAccuracy float64 `json:"averageAccuracy"`
	} `json:"progress,omitempty"`
}

type CreateSentenceResponse

type CreateSentenceResponse struct {
	// example: ὡς δέ οἱ ταῦτα ἔδοξε, καὶ ἐποίεε κατὰ τάχος·
	// required: true
	Sentence string `json:"sentence"`
	// example: fd4TlogBC__qOhD2dK31
	// required: true
	SentenceId string `json:"sentenceId"`
}

swagger:model

type CreationRequest added in v0.1.10

type CreationRequest struct {
	Theme    string `json:"theme"`
	Set      string `json:"set"`
	QuizType string `json:"quizType"`
}

type DatabaseHealth

type DatabaseHealth struct {
	// example: true
	Healthy bool `json:"healthy"`
	// example: aristoteles
	ClusterName string `json:"clusterName,omitempty"`
	// example: aristoteles-es-worker-0
	ServerName string `json:"serverName,omitempty"`
	// example: 8.8.0
	ServerVersion string `json:"serverVersion,omitempty"`
}

swagger:model

type Declension

type Declension struct {
	Name        string              `json:"name"`
	Type        string              `json:"type,omitempty"`
	Dialect     string              `json:"dialect"`
	Declensions []DeclensionElement `json:"declensions"`
}

func UnmarshalDeclension

func UnmarshalDeclension(data []byte) (Declension, error)

func (*Declension) Marshal

func (r *Declension) Marshal() ([]byte, error)

type DeclensionConfig

type DeclensionConfig struct {
	Declensions []Declension
}

type DeclensionElement

type DeclensionElement struct {
	Declension string   `json:"declension"`
	RuleName   string   `json:"ruleName"`
	SearchTerm []string `json:"searchTerm"`
}

type DeclensionTranslationResults

type DeclensionTranslationResults struct {
	Results []Result `json:"results"`
}

swagger:model

func UnmarshalDeclensionTranslationResults

func UnmarshalDeclensionTranslationResults(data []byte) (DeclensionTranslationResults, error)

func (*DeclensionTranslationResults) Marshal

func (r *DeclensionTranslationResults) Marshal() ([]byte, error)

func (*DeclensionTranslationResults) RemoveIndex

func (r *DeclensionTranslationResults) RemoveIndex(index int)

type Dialogue added in v0.1.8

type Dialogue struct {
	Introduction string `json:"introduction"`
	Speakers     []struct {
		Name        string `json:"name"`
		Shorthand   string `json:"shorthand"`
		Translation string `json:"translation"`
	} `json:"speakers"`
	Section       string `json:"section"`
	LinkToPerseus string `json:"linkToPerseus"`
}

type DialogueAnswer added in v0.1.10

type DialogueAnswer struct {
	Percentage   float64              `json:"percentage"`
	Input        []DialogueContent    `json:"input"`
	Answer       []DialogueContent    `json:"answer"`
	InWrongPlace []DialogueCorrection `json:"wronglyPlaced"`
}

type DialogueContent added in v0.1.8

type DialogueContent struct {
	Translation string `json:"translation"`
	Greek       string `json:"greek,omitempty"`
	Place       int    `json:"place,omitempty"`
	Speaker     string `json:"speaker,omitempty"`
}

type DialogueCorrection added in v0.1.10

type DialogueCorrection struct {
	Translation  string `json:"translation"`
	Greek        string `json:"greek,omitempty"`
	Place        int    `json:"place,omitempty"`
	Speaker      string `json:"speaker,omitempty"`
	CorrectPlace int    `json:"correctPlace,omitempty"`
}

type DialogueQuiz added in v0.1.8

type DialogueQuiz struct {
	QuizMetadata struct {
		Language string `json:"language"`
	} `json:"quizMetadata"`
	Theme    string            `json:"theme,omitempty"`
	QuizType string            `json:"quizType"`
	Set      int               `json:"set,omitempty"`
	Dialogue Dialogue          `json:"dialogue,omitempty"`
	Content  []DialogueContent `json:"content"`
}

type ElasticErrorMessage

type ElasticErrorMessage struct {
	ElasticError string `json:"elasticError"`
}

swagger:model

type ElasticSearchError

type ElasticSearchError struct {
	ErrorModel
	Message ElasticErrorMessage `json:"errorModel"`
}

swagger:model

func (*ElasticSearchError) Error

func (m *ElasticSearchError) Error() string

type ErrorModel

type ErrorModel struct {
	// required: true
	// example: 94374b4f-3dda-4ffb-b33b-2cb6ba092b84
	UniqueCode string `json:"uniqueCode"`
}

swagger:model ErrorModel is the base model used for handling errors

type FoundRules

type FoundRules struct {
	Rules []Rule `json:"rules"`
}

func UnmarshalFoundRules

func UnmarshalFoundRules(data []byte) (FoundRules, error)

func (*FoundRules) Marshal

func (r *FoundRules) Marshal() ([]byte, error)

type Health

type Health struct {
	// example: true
	Healthy bool `json:"healthy"`
	// example: 2023-06-07 15:02:11.678766777 +0000 UTC m=+5090.268683461
	Time     string         `json:"time"`
	Database DatabaseHealth `json:"databaseHealth,omitempty"`
	Memory   Memory         `json:"memory,omitempty"`
}

swagger:model

func UnmarshalHealth

func UnmarshalHealth(data []byte) (Health, error)

func (*Health) Marshal

func (r *Health) Marshal() ([]byte, error)

type Logos

type Logos struct {
	Logos []Word `json:"logos"`
}

swagger:model

func UnmarshalLogos

func UnmarshalLogos(data []byte) (Logos, error)

func (*Logos) Marshal

func (r *Logos) Marshal() ([]byte, error)

type Match

type Match struct {
	// example: superduperword
	// required: true
	Match string `json:"match"`
	// example: 4
	// required: true
	Levenshtein int `json:"levenshtein"`
	// example: 3
	// required: true
	AnswerIndex int `json:"answerIndex"`
	// example: 25.00
	// required: true
	Percentage string `json:"percentage"`
}

swagger:model

type MatchingWord

type MatchingWord struct {
	// example: thiswordisinthetext
	// required: true
	Word string `json:"word"`
	// example: 4
	// required: true
	SourceIndex int `json:"sourceIndex"`
}

swagger:model

type MediaContent added in v0.1.9

type MediaContent struct {
	Translation string `json:"translation"`
	Greek       string `json:"greek,omitempty"`
	ImageURL    string `json:"imageURL,omitempty"`
	AudioFile   string `json:"audioFile,omitempty"`
}

type MediaQuiz added in v0.1.9

type MediaQuiz struct {
	QuizMetadata struct {
		Language string `json:"language"`
	} `json:"quizMetadata"`
	QuizType string         `json:"quizType"`
	Set      int            `json:"set,omitempty"`
	Content  []MediaContent `json:"content"`
}

type Memory

type Memory struct {
	Free       uint64 `json:"free,omitempty"`
	Alloc      uint64 `json:"alloc,omitempty"`
	TotalAlloc uint64 `json:"totalAlloc,omitempty"`
	Sys        uint64 `json:"sys,omitempty"`
	Unit       string `json:"unit,omitempty"`
}

swagger:model

type Meros

type Meros struct {
	// example: ὄνος
	// required: true
	Greek string `json:"greek"`
	// example: an ass
	// required: true
	English string `json:"english"`
	// example: ezel
	// required: false
	Dutch string `json:"dutch,omitempty"`
	// required: false
	LinkedWord string `json:"linkedWord,omitempty"`
	// required: false
	Original string `json:"original,omitempty"`
}

swagger:model

func UnmarshalMeros

func UnmarshalMeros(data []byte) (Meros, error)

func (*Meros) Marshal

func (r *Meros) Marshal() ([]byte, error)

type MethodError

type MethodError struct {
	ErrorModel
	Messages []MethodMessages `json:"errorModel"`
}

swagger:model

type MethodMessages

type MethodMessages struct {
	// example: GET
	Methods string `json:"allowedMethods"`
	// example: Method DELETE not allowed at this endpoint
	Message string `json:"methodError"`
}

MethodMessages messages used in method error swagger:model

type NonMatchingWord

type NonMatchingWord struct {
	// example: step
	// required: true
	Word string `json:"word"`
	// example: 3
	// required: true
	SourceIndex int     `json:"sourceIndex"`
	Matches     []Match `json:"matches"`
}

swagger:model

type NotFoundError

type NotFoundError struct {
	ErrorModel
	Message NotFoundMessage `json:"errorModel"`
}

swagger:model

func (*NotFoundError) Error

func (m *NotFoundError) Error() string

type NotFoundMessage

type NotFoundMessage struct {
	// example: query for obscura
	Type string `json:"type"`
	// example: produced 0 results
	Reason string `json:"reason"`
}

swagger:model

type Options added in v0.1.10

type Options struct {
	Option   string `json:"quizWord"`
	AudioUrl string `json:"audioUrl,omitempty"`
	ImageUrl string `json:"imageUrl,omitempty"`
}

type QuizAttempt added in v0.1.10

type QuizAttempt struct {
	Correct bool
	Set     string
	Theme   string
}

type QuizResponse

type QuizResponse struct {
	QuizItem string    `json:"quizItem"`
	Options  []Options `json:"options,omitempty"`
}

type Result

type Result struct {
	// example: ἔβαλλε
	// required: true
	Word string `json:"word"`
	// example: 3th sing - impf - ind - act
	// required: true
	Rule string `json:"rule"`
	// example: βαλλω
	// required: true
	RootWord string `json:"rootWord"`
	// example: throw
	// required: true
	Translation string `json:"translation"`
}

swagger:model

type ResultModel

type ResultModel struct {
	// example: pong
	// required: true
	Result string `json:"result"`
}

swagger:model

type Rhema

type Rhema struct {
	Rhemai []RhemaSource `json:"rhemai"`
}

swagger:model

type RhemaSource

type RhemaSource struct {
	// example: Herodotos
	// required: true
	Author string `json:"author"`
	// example: ὡς δέ οἱ ταῦτα ἔδοξε, καὶ ἐποίεε κατὰ τάχος·
	// required: true
	Greek string `json:"greek"`
	// example: ["first translation", "second translation"]
	// required: true
	Translations []string `json:"translations"`
	// example: 1
	// required: true
	Book int64 `json:"book"`
	// example: 1
	// required: true
	Chapter int64 `json:"chapter"`
	// example: 1
	// required: true
	Section int64 `json:"section"`
	// example: https://externallink
	// required: true
	PerseusTextLink string `json:"perseusTextLink"`
}

swagger:model

func UnmarshalRhema

func UnmarshalRhema(data []byte) (RhemaSource, error)

func (*RhemaSource) Marshal

func (r *RhemaSource) Marshal() ([]byte, error)

type Rule

type Rule struct {
	Rule        string   `json:"rule,omitempty"`
	SearchTerms []string `json:"searchTerm,omitempty"`
}

type SolonCreationRequest

type SolonCreationRequest struct {
	// example: api
	// required: true
	Role string `json:"roles"`
	// example: [grammar dictionary]
	// required: true
	Access []string `json:"access"`
	// example: dionysios-544c584d7f-6sp6x
	// required: true
	PodName string `json:"podName"`
	// example: dionysios
	// required: true
	Username string `json:"username"`
}

swagger:model

func UnmarshalSolonCreationRequest

func UnmarshalSolonCreationRequest(data []byte) (SolonCreationRequest, error)

func (*SolonCreationRequest) Marshal

func (r *SolonCreationRequest) Marshal() ([]byte, error)

type SolonResponse

type SolonResponse struct {
	// example: true
	// required: true
	UserCreated bool `json:"userCreated"`
	// example: true
	// required: true
	SecretCreated bool `json:"secretCreated"`
}

swagger:model

func (*SolonResponse) Marshal

func (r *SolonResponse) Marshal() ([]byte, error)

type TokenResponse

type TokenResponse struct {
	// example: s.1283745jdf83r3
	// required: true
	Token string `json:"token"`
}

swagger:model

func (*TokenResponse) Marshal

func (r *TokenResponse) Marshal() ([]byte, error)

type ValidationError

type ValidationError struct {
	ErrorModel
	Messages []ValidationMessages `json:"errorModel"`
}

swagger:model ValidationError validation errors occur when data is malformed

type ValidationMessages

type ValidationMessages struct {
	// example: word
	Field string `json:"validationField"`
	// example: cannot be empty
	Message string `json:"validationMessage"`
}

swagger:model ValidationMessages messages used in validation error

type Word

type Word struct {
	// example: aristophanes
	// required: true
	Method string `json:"method"`
	// example: frogs
	// required: true
	Category string `json:"category"`
	// example: ὄνος
	// required: true
	Greek string `json:"greek"`
	// example: donkey
	// required: true
	Translation string `json:"translation"`
	// example: 1
	// required: true
	Chapter int64 `json:"chapter"`
}

swagger:model

func UnmarshalWord

func UnmarshalWord(data []byte) (Word, error)

func (*Word) Marshal

func (r *Word) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

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