yandex_translate

package
v0.0.0-...-e6602b1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Url = "https://translate.api.cloud.yandex.net/translate/v2/"
)

Variables

View Source
var BadRequest = errors.New("bad request")

Functions

func TestRequest

func TestRequest(token string) bool

func TranslateText

func TranslateText(text, lang string) (string, error)

Types

type ResponseDone

type ResponseDone struct {
	Translations []struct {
		Text                 string `json:"text"`
		DetectedLanguageCode string `json:"detectedLanguageCode"`
	} `json:"translations"`
}

type ResponseError

type ResponseError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Details []struct {
		Type      string `json:"@type"`
		RequestId string `json:"requestId"`
	} `json:"details"`
}

Jump to

Keyboard shortcuts

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