api

package
v0.0.0-...-eb38f5c Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFromDB

func DeleteFromDB(resp http.ResponseWriter, req *http.Request, client *mongo.Client, collection *mongo.Collection, id string) string

func GetData

func GetData(id string, resp http.ResponseWriter, req *http.Request, client *mongo.Client, collection *mongo.Collection) string

func GetDatasByDeviceID

func GetDatasByDeviceID(deviceID string, resp http.ResponseWriter, req *http.Request, client *mongo.Client, collection *mongo.Collection) string

func SaveTextToDB

func SaveTextToDB(resp http.ResponseWriter, req *http.Request, client *mongo.Client, collection *mongo.Collection, from string, to string, text string) string

Types

type Response

type Response struct {
	LangFrom string `json:"lang_from" bson:"lang_from"`
	LangTo   string `json:"lang_to" bson:"lang_to"`
	Text     string `json:"text" bson:"text"`
	Result   string `json:"result" bson:"result"`
}

func TranslateText

func TranslateText(langFrom, langTo, text string) (Response, error)

type VocabularyData

type VocabularyData struct {
	ID         string   `json:"_id" bson:"_id"`
	DeviceID   string   `json:"device_id" bson:"device_id"`
	Response   Response `json:"response" bson:"response"`
	CreateDate string   `json:"create_date" bson:"create_date"`
	IsActive   bool     `json:"is_active" bson:"is_active"`
}

Jump to

Keyboard shortcuts

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