src

package
v0.0.0-...-5c5cec6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppID      = "20210206000692280"
	AppSecrect = "OzA2CXkbniaOJ8McsbfR"
)
View Source
const (
	BaiduTranslateURL = "https://fanyi-api.baidu.com/api/trans/vip/translate"
)

Variables

This section is empty.

Functions

func Encode

func Encode(word string) map[string]string

func Translate

func Translate(word string)

Translate ...

Types

type Query

type Query struct {
	Q     string `json:"q"`
	From  string `json:"from"`
	To    string `json:"to"`
	AppID string `json:"appid"`
	Salt  string `json:"salt"`
	Sign  string `json:"sign"`
}

func (*Query) BuildFromAndTo

func (q *Query) BuildFromAndTo()

func (Query) ToMap

func (q Query) ToMap() map[string]string

type Response

type Response struct {
	From        string        `json:"from"`
	To          string        `json:"to"`
	TransResult []TransResult `json:"trans_result"`
	ErrorCode   int64         `json:"error_code"`
}

type TransResult

type TransResult struct {
	Src string `json:"src"`
	Dst string `json:"dst"`
}

Jump to

Keyboard shortcuts

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