Documentation ¶
Index ¶
- Constants
- Variables
- type AliTransEngine
- func (eng *AliTransEngine) LanCodeIn(code string) string
- func (eng *AliTransEngine) LanCodeOut(code string) string
- func (eng *AliTransEngine) TransText(src, from, to string, scene ...Scene) (data *TransResult, err error)
- func (eng *AliTransEngine) TransTextDirect(src, from, to string, scene ...Scene) (data *TransResult, err error)
- type BaiduTransEngine
- func (eng *BaiduTransEngine) LanCodeIn(code string) string
- func (eng *BaiduTransEngine) LanCodeOut(code string) string
- func (eng *BaiduTransEngine) SetJar(jar http.CookieJar) *BaiduTransEngine
- func (eng *BaiduTransEngine) SetTimeOut(timeout time.Duration) *BaiduTransEngine
- func (eng *BaiduTransEngine) SetTransport(transport http.RoundTripper) *BaiduTransEngine
- func (eng *BaiduTransEngine) TransText(src, from, to string, _ ...Scene) (data *TransResult, err error)
- func (eng *BaiduTransEngine) TransTextDirect(src, from, to string, _ ...Scene) (data *TransResult, err error)
- type IRequest
- type ITransEngine
- type Scene
- type TencentTransEngine
- func (eng *TencentTransEngine) LanCodeIn(code string) string
- func (eng *TencentTransEngine) LanCodeOut(code string) string
- func (eng *TencentTransEngine) SetRegion(region string) error
- func (eng *TencentTransEngine) TransText(src, from, to string, _ ...Scene) (data *TransResult, err error)
- func (eng *TencentTransEngine) TransTextDirect(src, from, to string, _ ...Scene) (data *TransResult, err error)
- type TransResp
- type TransResult
- type VolcTransEngine
- func (eng *VolcTransEngine) LanCodeIn(code string) string
- func (eng *VolcTransEngine) LanCodeOut(code string) string
- func (eng *VolcTransEngine) SetTimeout(timeout time.Duration)
- func (eng *VolcTransEngine) TransText(src, from, to string, _ ...Scene) (data *TransResult, err error)
- func (eng *VolcTransEngine) TransTextDirect(src, from, to string, _ ...Scene) (data *TransResult, err error)
- type YoudaoTransEngine
- func (eng *YoudaoTransEngine) LanCodeIn(code string) string
- func (eng *YoudaoTransEngine) LanCodeOut(code string) string
- func (eng *YoudaoTransEngine) SetJar(jar http.CookieJar) *YoudaoTransEngine
- func (eng *YoudaoTransEngine) SetTimeOut(timeout time.Duration) *YoudaoTransEngine
- func (eng *YoudaoTransEngine) SetTransport(transport http.RoundTripper) *YoudaoTransEngine
- func (eng *YoudaoTransEngine) TransText(src, from, to string, scene ...Scene) (data *TransResult, err error)
- func (eng *YoudaoTransEngine) TransTextDirect(src, from, to string, scene ...Scene) (data *TransResult, err error)
Constants ¶
View Source
const ( // ZH 中文 ZH = "zh" // ZH_TW 中文繁体 ZH_TW = "zh-TW" // EN 英文 EN = "en" // JA 日文 JA = "ja" // KO 韩文 KO = "ko" // FR 法文 FR = "fr" // ES 西班牙文 ES = "es" // PT 葡萄牙文 PT = "pt" // IT 意大利文 IT = "it" // RU 俄文 RU = "ru" // DE 德语 DE = "de" // TR 土耳其语 TR = "tr" // VI 越南语 VI = "vi" // ID 印尼 ID = "id" // TH 泰语 TH = "th" // MS 马来语 MS = "ms" // AUTO 自动识别,仅对from有效 AUTO = "auto" )
Variables ¶
View Source
var EngFactory = factory{}
Functions ¶
This section is empty.
Types ¶
type AliTransEngine ¶
type AliTransEngine struct {
// contains filtered or unexported fields
}
func (*AliTransEngine) LanCodeIn ¶
func (eng *AliTransEngine) LanCodeIn(code string) string
func (*AliTransEngine) LanCodeOut ¶
func (eng *AliTransEngine) LanCodeOut(code string) string
func (*AliTransEngine) TransText ¶
func (eng *AliTransEngine) TransText(src, from, to string, scene ...Scene) (data *TransResult, err error)
func (*AliTransEngine) TransTextDirect ¶
func (eng *AliTransEngine) TransTextDirect(src, from, to string, scene ...Scene) (data *TransResult, err error)
type BaiduTransEngine ¶
type BaiduTransEngine struct {
// contains filtered or unexported fields
}
func (*BaiduTransEngine) LanCodeIn ¶
func (eng *BaiduTransEngine) LanCodeIn(code string) string
func (*BaiduTransEngine) LanCodeOut ¶
func (eng *BaiduTransEngine) LanCodeOut(code string) string
func (*BaiduTransEngine) SetJar ¶
func (eng *BaiduTransEngine) SetJar(jar http.CookieJar) *BaiduTransEngine
func (*BaiduTransEngine) SetTimeOut ¶
func (eng *BaiduTransEngine) SetTimeOut(timeout time.Duration) *BaiduTransEngine
func (*BaiduTransEngine) SetTransport ¶
func (eng *BaiduTransEngine) SetTransport(transport http.RoundTripper) *BaiduTransEngine
func (*BaiduTransEngine) TransText ¶
func (eng *BaiduTransEngine) TransText(src, from, to string, _ ...Scene) (data *TransResult, err error)
func (*BaiduTransEngine) TransTextDirect ¶
func (eng *BaiduTransEngine) TransTextDirect(src, from, to string, _ ...Scene) (data *TransResult, err error)
type ITransEngine ¶
type TencentTransEngine ¶
type TencentTransEngine struct {
// contains filtered or unexported fields
}
func (*TencentTransEngine) LanCodeIn ¶
func (eng *TencentTransEngine) LanCodeIn(code string) string
func (*TencentTransEngine) LanCodeOut ¶
func (eng *TencentTransEngine) LanCodeOut(code string) string
func (*TencentTransEngine) SetRegion ¶
func (eng *TencentTransEngine) SetRegion(region string) error
func (*TencentTransEngine) TransText ¶
func (eng *TencentTransEngine) TransText(src, from, to string, _ ...Scene) (data *TransResult, err error)
func (*TencentTransEngine) TransTextDirect ¶
func (eng *TencentTransEngine) TransTextDirect(src, from, to string, _ ...Scene) (data *TransResult, err error)
type TransResult ¶
func TransText ¶
func TransText(src, from, to string, eng ITransEngine, scene ...Scene) (*TransResult, error)
type VolcTransEngine ¶
type VolcTransEngine struct {
// contains filtered or unexported fields
}
func (*VolcTransEngine) LanCodeIn ¶
func (eng *VolcTransEngine) LanCodeIn(code string) string
func (*VolcTransEngine) LanCodeOut ¶
func (eng *VolcTransEngine) LanCodeOut(code string) string
func (*VolcTransEngine) SetTimeout ¶
func (eng *VolcTransEngine) SetTimeout(timeout time.Duration)
func (*VolcTransEngine) TransText ¶
func (eng *VolcTransEngine) TransText(src, from, to string, _ ...Scene) (data *TransResult, err error)
func (*VolcTransEngine) TransTextDirect ¶
func (eng *VolcTransEngine) TransTextDirect(src, from, to string, _ ...Scene) (data *TransResult, err error)
type YoudaoTransEngine ¶
type YoudaoTransEngine struct {
// contains filtered or unexported fields
}
func (*YoudaoTransEngine) LanCodeIn ¶
func (eng *YoudaoTransEngine) LanCodeIn(code string) string
func (*YoudaoTransEngine) LanCodeOut ¶
func (eng *YoudaoTransEngine) LanCodeOut(code string) string
func (*YoudaoTransEngine) SetJar ¶
func (eng *YoudaoTransEngine) SetJar(jar http.CookieJar) *YoudaoTransEngine
func (*YoudaoTransEngine) SetTimeOut ¶
func (eng *YoudaoTransEngine) SetTimeOut(timeout time.Duration) *YoudaoTransEngine
func (*YoudaoTransEngine) SetTransport ¶
func (eng *YoudaoTransEngine) SetTransport(transport http.RoundTripper) *YoudaoTransEngine
func (*YoudaoTransEngine) TransText ¶
func (eng *YoudaoTransEngine) TransText(src, from, to string, scene ...Scene) (data *TransResult, err error)
func (*YoudaoTransEngine) TransTextDirect ¶
func (eng *YoudaoTransEngine) TransTextDirect(src, from, to string, scene ...Scene) (data *TransResult, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.