bdfy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

百度翻译

Index

Constants

This section is empty.

Variables

View Source
var (
	// 原文
	//	Q string = "apple"
	// 源语言
	From string = "auto"
	// 目标语言
	To string = "zh"

	// 改成您的APP ID
	AppId string = ""
	// 改成您的密钥
	SecretKey string = ""

	Salt string = strconv.Itoa(rand.Intn(65536))

	Bdurl string = "http://api.fanyi.baidu.com/api/trans/vip/translate?"
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Uid       int    `db:"uid"`
	AppId     string `db:"appid"`
	SecretKey string `db:"secretKey"`
}

type Trans

type Trans struct {
	From      string `json:"from"`
	To        string `json:"to"`
	ErrorCode string `json:"error_code"`
	ErrorMsg  string `json:"error_msg"`
	Tresult   []struct {
		Src string `json:"src"`
		Dst string `json:"dst"`
	} `json:"trans_result"`
}

func Tr

func Tr(Q string) (*Trans, error)

Jump to

Keyboard shortcuts

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