gatta

package module
v0.0.0-...-65fd3c4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 5 Imported by: 0

README

gatta

Simple Go command that uses Azure's Translator Text API

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TokenURL     = "https://api.cognitive.microsoft.com/sts/v1.0/issueToken"
	TranslateURL = "http://api.microsofttranslator.com/v2/Http.svc/Translate"
)

Functions

This section is empty.

Types

type Translator

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

func New

func New(key string) (*Translator, error)

func (*Translator) Translate

func (t *Translator) Translate(text, to string) (*http.Response, error)

Translate is a direct translation of the following cURL command:

curl -XGET -H "Authorization: Bearer $TOKEN" -H "Accept: application/xml" 'http://api.microsofttranslator.com/v2/Http.svc/Translate?text=$TEXT&to=$TO'

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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