Documentation ¶
Index ¶
- Constants
- func GrpcTranslate(msg *proto.ST_Translation_Req_PB) *proto.ST_Translation_Respon_PB
- func Translate(respon *httputils.Respon, languageID uint32, content string)
- type BaiduResult
- type BaiduTransResult
- type GoogleError
- type GoogleResult
- type GoogleTranslationItem
- type GoogleTranslations
- type TransResult
Constants ¶
View Source
const ( BaiduAPPID = 20170721000065581 BaiduSecretKey = "3GuX90c4M8MdTwIW8D3X" BaiduServerUrl = "https://fanyi-api.baidu.com/api/trans/vip/translate" GoogleServerUrl = "https://translation.googleapis.com/language/translate/v2" GoogleSecretkey = "AIzaSyAPbH8kU7NYbVk_hOQsL2IwRE45A_9Mtyk" )
Variables ¶
This section is empty.
Functions ¶
func GrpcTranslate ¶
func GrpcTranslate(msg *proto.ST_Translation_Req_PB) *proto.ST_Translation_Respon_PB
Types ¶
type BaiduResult ¶
type BaiduResult struct { Error_code string Error_msg string From string To string Trans_result []*BaiduTransResult }
type BaiduTransResult ¶
type GoogleError ¶
type GoogleResult ¶
type GoogleResult struct { Data *GoogleTranslations Error *GoogleError }
type GoogleTranslationItem ¶
type GoogleTranslations ¶
type GoogleTranslations struct {
Translations []*GoogleTranslationItem
}
type TransResult ¶
Click to show internal directories.
Click to hide internal directories.