models

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 1 Imported by: 41

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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 Categories

type Categories struct {
	Category []Category `json:"categories"`
}

swagger:model

type Category

type Category struct {
	// example: frogs
	// required: true
	Category string `json:"category"`
}

swagger:model

type CheckAnswerRequest

type CheckAnswerRequest struct {
	// example: ὄνος
	// required: true
	QuizWord string `json:"quizWord"`
	// example: horse
	// required: true
	AnswerProvided string `json:"answerProvided"`
}

swagger:model

func (*CheckAnswerRequest) Marshal

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

type CheckAnswerResponse

type CheckAnswerResponse struct {
	// example: false
	// required: true
	Correct bool `json:"correct"`
	// example: ὄνος
	// required: true
	QuizWord      string `json:"quizWord"`
	Possibilities []Word `json:"possibilities"`
}

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 CreateSentenceResponse

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

swagger:model

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 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 LastChapterResponse

type LastChapterResponse struct {
	// example: 119
	// required: true
	LastChapter int64 `json:"lastChapter"`
}

swagger:model

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 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 Method

type Method struct {
	// example: aristophanes
	// required: true
	Method string `json:"method"`
}

swagger:model

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 Methods

type Methods struct {
	Method []Method `json:"methods"`
}

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 QuizResponse

type QuizResponse struct {
	// example: ὄνος
	// required: true
	Question string `json:"question"`
	// example: donkey
	// required: true
	Answer string `json:"answer"`
	// example: ["donkey", "anotheranswer"]
	// required: true
	QuizQuestions []string `json:"quiz"`
}

swagger:model

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