Documentation
¶
Index ¶
- Variables
- type AdditionalSense
- type ApiResponse
- type Article
- type ArticleCategory
- type Client
- type ClientOption
- type Conjugation
- type ConjugationImperative
- type ConjugationIndicative
- type ConjugationNonPersonal
- type ConjugationSubjunctive
- type Conjugations
- type Definition
- type Gender
- type Locution
- type Meaning
- type Origin
- type OriginType
- type SearchResult
- type Usage
- type VerbCategory
- type VerbalMode
- type VoiceType
- type WordCategory
- type WordEntry
- type WordEntryResponse
- type WordResponse
- type WordSingle
Constants ¶
This section is empty.
Variables ¶
var (
ErrWordNotFound = errors.New("word not found")
)
Functions ¶
This section is empty.
Types ¶
type AdditionalSense ¶
type AdditionalSense struct {
Number int `json:"number"`
Definition string `json:"definition"`
Locutions []Locution `json:"locutions"`
}
func (AdditionalSense) MarshalEasyJSON ¶ added in v0.5.0
func (v AdditionalSense) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AdditionalSense) MarshalJSON ¶ added in v0.5.0
func (v AdditionalSense) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AdditionalSense) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *AdditionalSense) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AdditionalSense) UnmarshalJSON ¶ added in v0.5.0
func (v *AdditionalSense) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ApiResponse ¶ added in v0.2.0
type Article ¶
type Article struct {
Category ArticleCategory `json:"category"`
Gender Gender `json:"gender"`
}
func (Article) MarshalEasyJSON ¶ added in v0.5.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Article) MarshalJSON ¶ added in v0.5.0
MarshalJSON supports json.Marshaler interface
func (*Article) UnmarshalEasyJSON ¶ added in v0.5.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Article) UnmarshalJSON ¶ added in v0.5.0
UnmarshalJSON supports json.Unmarshaler interface
type ArticleCategory ¶
type ArticleCategory string
const ( ArticleCategoryDefinite ArticleCategory = "definite" ArticleCategoryIndefinite ArticleCategory = "indefinite" ArticleCategoryNeuter ArticleCategory = "neuter" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(*Client)
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
func WithVersion ¶
func WithVersion(version string) ClientOption
type Conjugation ¶
type Conjugation struct {
SingularFirstPerson string `json:"singular_first_person"`
SingularSecondPerson string `json:"singular_second_person"`
SingularFormalSecondPerson string `json:"singular_formal_second_person"`
SingularThirdPerson string `json:"singular_third_person"`
PluralFirstPerson string `json:"plural_first_person"`
PluralSecondPerson string `json:"plural_second_person"`
PluralFormalSecondPerson string `json:"plural_formal_second_person"`
PluralThirdPerson string `json:"plural_third_person"`
}
func (Conjugation) MarshalEasyJSON ¶ added in v0.5.0
func (v Conjugation) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Conjugation) MarshalJSON ¶ added in v0.5.0
func (v Conjugation) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Conjugation) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *Conjugation) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Conjugation) UnmarshalJSON ¶ added in v0.5.0
func (v *Conjugation) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ConjugationImperative ¶
type ConjugationImperative struct {
SingularSecondPerson string `json:"singular_second_person"`
SingularFormalSecondPerson string `json:"singular_formal_second_person"`
PluralSecondPerson string `json:"plural_second_person"`
PluralFormalSecondPerson string `json:"plural_formal_second_person"`
}
func (ConjugationImperative) MarshalEasyJSON ¶ added in v0.5.0
func (v ConjugationImperative) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConjugationImperative) MarshalJSON ¶ added in v0.5.0
func (v ConjugationImperative) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConjugationImperative) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *ConjugationImperative) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConjugationImperative) UnmarshalJSON ¶ added in v0.5.0
func (v *ConjugationImperative) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ConjugationIndicative ¶
type ConjugationIndicative struct {
Present Conjugation `json:"present"`
PresentPerfect Conjugation `json:"present_perfect"` // Pretérito perfecto compuesto / Antepresente
Imperfect Conjugation `json:"imperfect"` // Pretérito imperfecto / Copretérito
PastPerfect Conjugation `json:"past_perfect"` // Pretérito pluscuamperfecto / Antecopretérito
Preterite Conjugation `json:"preterite"` // Pretérito perfecto simple / Pretérito
PastAnterior Conjugation `json:"past_anterior"` // Pretérito anterior / Antepretérito
Future Conjugation `json:"future"` // Futuro simple
FuturePerfect Conjugation `json:"future_perfect"` // Futuro compuesto / Antefuturo
Conditional Conjugation `json:"conditional"` // Condicional simple / Pospretérito
ConditionalPerfect Conjugation `json:"conditional_perfect"` // Condicional compuesto / Antepospretérito
}
func (ConjugationIndicative) MarshalEasyJSON ¶ added in v0.5.0
func (v ConjugationIndicative) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConjugationIndicative) MarshalJSON ¶ added in v0.5.0
func (v ConjugationIndicative) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConjugationIndicative) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *ConjugationIndicative) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConjugationIndicative) UnmarshalJSON ¶ added in v0.5.0
func (v *ConjugationIndicative) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ConjugationNonPersonal ¶
type ConjugationNonPersonal struct {
Infinitive string `json:"infinitive"`
Participle string `json:"participle"`
Gerund string `json:"gerund"`
CompoundInfinitive string `json:"compound_infinitive"`
CompoundGerund string `json:"compound_gerund"`
}
func (ConjugationNonPersonal) MarshalEasyJSON ¶ added in v0.5.0
func (v ConjugationNonPersonal) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConjugationNonPersonal) MarshalJSON ¶ added in v0.5.0
func (v ConjugationNonPersonal) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConjugationNonPersonal) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *ConjugationNonPersonal) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConjugationNonPersonal) UnmarshalJSON ¶ added in v0.5.0
func (v *ConjugationNonPersonal) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ConjugationSubjunctive ¶
type ConjugationSubjunctive struct {
Present Conjugation `json:"present"`
PresentPerfect Conjugation `json:"present_perfect"` // Pretérito perfecto compuesto / Antepresente
Imperfect Conjugation `json:"imperfect"` // Pretérito imperfecto / Pretérito
PastPerfect Conjugation `json:"past_perfect"` // Pretérito pluscuamperfecto / Antepretérito
Future Conjugation `json:"future"` // Futuro simple
FuturePerfect Conjugation `json:"future_perfect"` // Futuro compuesto / Antefuturo
}
func (ConjugationSubjunctive) MarshalEasyJSON ¶ added in v0.5.0
func (v ConjugationSubjunctive) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConjugationSubjunctive) MarshalJSON ¶ added in v0.5.0
func (v ConjugationSubjunctive) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConjugationSubjunctive) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *ConjugationSubjunctive) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConjugationSubjunctive) UnmarshalJSON ¶ added in v0.5.0
func (v *ConjugationSubjunctive) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Conjugations ¶
type Conjugations struct {
ConjugationNonPersonal ConjugationNonPersonal `json:"non_personal"`
ConjugationIndicative ConjugationIndicative `json:"indicative"`
ConjugationSubjunctive ConjugationSubjunctive `json:"subjunctive"`
ConjugationImperative ConjugationImperative `json:"imperative"`
}
func (Conjugations) MarshalEasyJSON ¶ added in v0.5.0
func (v Conjugations) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Conjugations) MarshalJSON ¶ added in v0.5.0
func (v Conjugations) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Conjugations) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *Conjugations) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Conjugations) UnmarshalJSON ¶ added in v0.5.0
func (v *Conjugations) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Definition ¶
type Definition struct {
Raw string `json:"raw"`
MeaningNumber int `json:"meaning_number"`
Category WordCategory `json:"category"`
VerbCategory *VerbCategory `json:"verb_category,omitempty"`
Gender *Gender `json:"gender,omitempty"`
Article *Article `json:"article,omitempty"`
Usage Usage `json:"usage"`
Description string `json:"description"`
Synonyms []string `json:"synonyms"`
Antonyms []string `json:"antonyms"`
}
Definition represents a word definition.
func (Definition) MarshalEasyJSON ¶ added in v0.5.0
func (v Definition) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Definition) MarshalJSON ¶ added in v0.5.0
func (v Definition) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Definition) UnmarshalEasyJSON ¶ added in v0.5.0
func (v *Definition) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Definition) UnmarshalJSON ¶ added in v0.5.0
func (v *Definition) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Locution ¶
func (Locution) MarshalEasyJSON ¶ added in v0.5.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Locution) MarshalJSON ¶ added in v0.5.0
MarshalJSON supports json.Marshaler interface
func (*Locution) UnmarshalEasyJSON ¶ added in v0.5.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Locution) UnmarshalJSON ¶ added in v0.5.0
UnmarshalJSON supports json.Unmarshaler interface
type Meaning ¶
type Meaning struct {
Origin *Origin `json:"origin,omitempty"`
Definitions []Definition `json:"senses"`
Conjugations *Conjugations `json:"conjugations,omitempty"`
}
func (Meaning) MarshalEasyJSON ¶ added in v0.5.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Meaning) MarshalJSON ¶ added in v0.5.0
MarshalJSON supports json.Marshaler interface
func (*Meaning) UnmarshalEasyJSON ¶ added in v0.5.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Meaning) UnmarshalJSON ¶ added in v0.5.0
UnmarshalJSON supports json.Unmarshaler interface
type Origin ¶
type Origin struct {
Raw string `json:"raw"`
Type OriginType `json:"type"`
Voice VoiceType `json:"voice"`
Text string `json:"text"`
}
type OriginType ¶
type OriginType string
const ( OriginLatin OriginType = "lat" OriginUncertain OriginType = "uncertain" )
type SearchResult ¶ added in v0.7.0
type SearchResult struct {
Doc doc `json:"doc"`
Hits int `json:"hits"`
}
func (SearchResult) MarshalEasyJSON ¶ added in v0.7.0
func (v SearchResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SearchResult) MarshalJSON ¶ added in v0.7.0
func (v SearchResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SearchResult) UnmarshalEasyJSON ¶ added in v0.7.0
func (v *SearchResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SearchResult) UnmarshalJSON ¶ added in v0.7.0
func (v *SearchResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*SearchResult) WordEntry ¶ added in v0.7.0
func (sr *SearchResult) WordEntry() (*WordEntry, error)
type VerbCategory ¶
type VerbCategory string
const ( VerbCategoryTransitive VerbCategory = "transitive" // Verbos transitivos VerbCategoryIntransitive VerbCategory = "intransitive" // Verbos intransitivos VerbCategoryCopulative VerbCategory = "copulative" // Verbos copulativos VerbCategoryReflexive VerbCategory = "reflexive" // Verbos reflexivos VerbCategoryDefective VerbCategory = "defective" // Verbos defectivos VerbCategoryPronominal VerbCategory = "pronominal" // Verbos recíprocos VerbCategoryAuxiliary VerbCategory = "auxiliary" // Verbos auxiliares VerbCategoryPredicative VerbCategory = "predicative" // Verbos predicativos )
type VerbalMode ¶
type VerbalMode string
const ( VerbalModeIndicative VerbalMode = "indicative" VerbalModeSubjunctive VerbalMode = "subjunctive" VerbalModeImperative VerbalMode = "imperative" VerbalModeNonPersonal VerbalMode = "nonpersonal" )
type WordCategory ¶
type WordCategory string
const ( CategoryArticle WordCategory = "article" // articulo CategoryNoun WordCategory = "noun" // sustantivo CategoryPronoun WordCategory = "pronoun" CategoryAdjective WordCategory = "adjective" CategoryVerb WordCategory = "verb" CategoryAdverb WordCategory = "adverb" CategoryPreposition WordCategory = "preposition" CategoryConjunction WordCategory = "conjunction" CategoryInterjection WordCategory = "interjection" )
type WordEntry ¶
type WordEntry struct {
Word string `json:"word"`
Meanings []Meaning `json:"meanings"`
Suggestions []string `json:"suggestions"`
}
func (WordEntry) MarshalEasyJSON ¶ added in v0.5.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (WordEntry) MarshalJSON ¶ added in v0.5.0
MarshalJSON supports json.Marshaler interface
func (*WordEntry) UnmarshalEasyJSON ¶ added in v0.5.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WordEntry) UnmarshalJSON ¶ added in v0.5.0
UnmarshalJSON supports json.Unmarshaler interface
type WordEntryResponse ¶
type WordEntryResponse = ApiResponse[WordEntry]
type WordResponse ¶ added in v0.2.0
type WordResponse = ApiResponse[WordSingle]
type WordSingle ¶ added in v0.2.0
type WordSingle struct {
Word string `json:"word"`
}