translate

package
v0.0.0-...-04ff805 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultYoudaoAppId     = "2f871f8481e49b4c"
	DefaultYoudaoAppSecret = "CQFItxl9hPXuQuVcQa5F2iPmZSbN0hYS"
)

Variables

This section is empty.

Functions

func GoogleTranslateByWeb

func GoogleTranslateByWeb(SourceLang, TargetLang, Text, Proxy string, timeout *time.Duration) (string, error)

func YoudaoTranslateEnCnAuto

func YoudaoTranslateEnCnAuto(appId, appSecret, s string) (string, error)

Types

type Client

type Client struct {
	SourceLang string
	TargetLang string
}

func NewClient

func NewClient(SourceLang, TargetLang string) *Client

func (*Client) Translate

func (c *Client) Translate(text, proxy string, timeout *time.Duration) *translator

type Response

type Response struct {
	Err          error
	Status       string
	StatusCode   int
	ResponseBody []byte
}

Jump to

Keyboard shortcuts

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