Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BaiduHttpApiGateway = "http://api.fanyi.baidu.com/api/trans/vip/translate" BaiduHttpsApiGateway = "https://fanyi-api.baidu.com/api/trans/vip/translate" )
Functions ¶
func GetHttpClient ¶
Types ¶
type BaiduResp ¶
type BaiduResp struct { BaiduRespErr From Language `json:"from,omitempty"` To Language `json:"to,omitempty"` TransResult []struct { SRC string `json:"src"` DST string `json:"dst"` } `json:"trans_result,omitempty"` }
type BaiduRespErr ¶
type BaiduRespErr struct { ErrorCode int `json:"error_code,string,omitempty"` ErrorMsg string `json:"error_msg,omitempty"` }
func (BaiduRespErr) Error ¶
func (b BaiduRespErr) Error() string
type ITranslate ¶
func NewBaiduTranslate ¶
func NewBaiduTranslate(appID, appSecret, apiGateway string) ITranslate
Click to show internal directories.
Click to hide internal directories.