Documentation
¶
Index ¶
- Constants
- type Aggregate
- type AggregateResult
- type AnswerRequest
- type Author
- type AuthorBasedContent
- type AuthorBasedQuiz
- type Authors
- type Biblos
- type Book
- type Books
- type CheckSentenceRequest
- type CheckSentenceResponse
- type ComprehensiveResponse
- type CreateSentenceResponse
- type CreationRequest
- type DatabaseHealth
- type Declension
- type DeclensionConfig
- type DeclensionElement
- type DeclensionTranslationResults
- type Dialogue
- type DialogueAnswer
- type DialogueContent
- type DialogueCorrection
- type DialogueQuiz
- type ElasticErrorMessage
- type ElasticSearchError
- type ErrorModel
- type ExtendedResponse
- type FoundRules
- type Health
- type Hit
- type Logos
- type Match
- type MatchingWord
- type MediaContent
- type MediaQuiz
- type Memory
- type Meros
- type MethodError
- type MethodMessages
- type NonMatchingWord
- type NotFoundError
- type NotFoundMessage
- type Options
- type QuizAttempt
- type QuizResponse
- type Result
- type ResultModel
- type Rhema
- type RhemaSource
- type Rule
- type SolonCreationRequest
- type SolonResponse
- type TokenResponse
- type ValidationError
- type ValidationMessages
- type Word
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 AggregateResult ¶ added in v0.1.10
type AggregateResult struct {
Aggregates []Aggregate `json:"aggregates"`
}
type AnswerRequest ¶ added in v0.1.10
type Author ¶
type Author struct { // example: herodotos // required: true Author string `json:"author"` }
swagger:model
func UnmarshalAuthors ¶
type AuthorBasedContent ¶ added in v0.1.9
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 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 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 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 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 DialogueCorrection ¶ added in v0.1.10
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 ExtendedResponse ¶ added in v0.1.13
type ExtendedResponse struct {
Hits []Hit `json:"hits,omitempty"`
}
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 ¶
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 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"` Theme string `json:"theme,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"` }
func UnmarshalMeros ¶
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 QuizAttempt ¶ added in v0.1.10
type QuizResponse ¶
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 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 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 ¶
Click to show internal directories.
Click to hide internal directories.