pkg

package
v0.0.0-...-27c4f9f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log        ILogger
	Repository VerbRepository
}

func (*Config) Routes

func (app *Config) Routes() http.Handler

type Conjugation

type Conjugation struct {
	I         string `bson:"yo"                         json:"yo"`
	You       string `bson:"tú"                         json:"tú"`
	We        string `bson:"nosotros"                   json:"nosotros"`
	YouPlural string `bson:"vosotros"                   json:"vosotros"`
	It        string `bson:"él/ella/Ud."                json:"él/ella/Ud."`
	They      string `bson:"ellos/ellas/Uds."           json:"ellos/ellas/Uds."`
}

type ConjugationImperative

type ConjugationImperative struct {
	I         string `bson:"yo"        json:"yo"`
	It        string `bson:"Ud."       json:"Ud."`
	You       string `bson:"tú"        json:"tú"`
	They      string `bson:"Uds."      json:"Uds."`
	We        string `bson:"nosotros"  json:"nosotros"`
	YouPlural string `bson:"vosotros"  json:"vosotros"`
}

type ILogger

type ILogger interface {
	Info(v ...interface{})
	Error(v ...interface{})
	Debug(v ...interface{})
}

type ImperativeTime

type ImperativeTime struct {
	Negative    ConjugationImperative `bson:"negativo"      json:"negativo"`
	Affirmative ConjugationImperative `bson:"afirmativo"    json:"afirmativo"`
}

type IndicativeTime

type IndicativeTime struct {
	Future      Conjugation `bson:"futuro"        json:"futuro"`
	Present     Conjugation `bson:"presente"      json:"presente"`
	Preterite   Conjugation `bson:"preterito"     json:"preterito"`
	Imperfect   Conjugation `bson:"imperfecto"    json:"imperfecto"`
	Conditional Conjugation `bson:"condicional"   json:"condicional"`
}

type Logger

type Logger struct {
	InfoLogger  *log.Logger
	ErrorLogger *log.Logger
	DebugLogger *log.Logger
	IsDevMode   bool
}

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

type MongoDatabase

type MongoDatabase struct {
	DSN string
	Log ILogger
	// contains filtered or unexported fields
}

func (*MongoDatabase) ConnectToMongo

func (db *MongoDatabase) ConnectToMongo() error

func (*MongoDatabase) GetCollection

func (db *MongoDatabase) GetCollection(collName string) (*mongo.Collection, error)

func (*MongoDatabase) PingDB

func (db *MongoDatabase) PingDB()

type PerfectSubjunctiveTime

type PerfectSubjunctiveTime struct {
	Future  Conjugation `bson:"futuro"        json:"futuro"`
	Past    Conjugation `bson:"pasado"        json:"pasado"`
	Present Conjugation `bson:"presente"      json:"presente"`
}

type PerfectTime

type PerfectTime struct {
	Future      Conjugation `bson:"futuro"        json:"futuro"`
	Past        Conjugation `bson:"pasado"        json:"pasado"`
	Present     Conjugation `bson:"presente"      json:"presente"`
	Preterite   Conjugation `bson:"preterito"     json:"preterito"`
	Conditional Conjugation `bson:"condicional"   json:"condicional"`
}

type ProgressiveTime

type ProgressiveTime struct {
	Future      Conjugation `bson:"futuro"        json:"futuro"`
	Present     Conjugation `bson:"presente"      json:"presente"`
	Preterite   Conjugation `bson:"preterito"     json:"preterito"`
	Imperfect   Conjugation `bson:"imperfecto"    json:"imperfecto"`
	Conditional Conjugation `bson:"condicional"   json:"condicional"`
}

type SearchResult

type SearchResult struct {
	Verbo string `bson:"verbo" json:"verbo"`
}

type SubjunctiveTime

type SubjunctiveTime struct {
	Future     Conjugation `bson:"futuro"        json:"futuro"`
	Present    Conjugation `bson:"presente"      json:"presente"`
	Imperfect  Conjugation `bson:"imperfecto"    json:"imperfecto"`
	Imperfect2 Conjugation `bson:"imperfecto2"   json:"imperfecto2"`
}

type VerbConjugation

type VerbConjugation struct {
	Verb               string                 `bson:"verbo"                        json:"verbo"`
	Imperative         ImperativeTime         `bson:"imperativo,omitempty"         json:"imperativo,omitempty"`
	Indicative         IndicativeTime         `bson:"indicativo,omitempty"         json:"indicativo,omitempty"`
	Perfect            PerfectTime            `bson:"perfecto,omitempty"           json:"perfecto,omitempty"`
	PerfectSubjunctive PerfectSubjunctiveTime `bson:"perfect_subjuntivo,omitempty" json:"perfect_subjuntivo,omitempty"`
	Progressive        ProgressiveTime        `bson:"progresivo,omitempty"         json:"progresivo,omitempty"`
	Subjunctive        SubjunctiveTime        `bson:"subjuntivo,omitempty"         json:"subjuntivo,omitempty"`
}

type VerbRepo

type VerbRepo struct {
	// contains filtered or unexported fields
}

func CreateVerbRepository

func CreateVerbRepository(db *mongo.Collection) *VerbRepo

func (*VerbRepo) FindVerb

func (repo *VerbRepo) FindVerb(ctx context.Context, verbName string) (*VerbConjugation, error)

func (*VerbRepo) SearchVerb

func (repo *VerbRepo) SearchVerb(ctx context.Context, queryWord string) ([]string, error)

type VerbRepository

type VerbRepository interface {
	FindVerb(ctx context.Context, verbName string) (*VerbConjugation, error)
	SearchVerb(ctx context.Context, queryWord string) ([]string, error)
}

Jump to

Keyboard shortcuts

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