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'
Click to show internal directories.
Click to hide internal directories.