trans

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CL = "cl"
	XT = "xt"
	DT = "dt"
	XH = "xh"
	ZH = "zh"
)
View Source
const (
	YOUDAO = "youdao"
)

Variables

View Source
var FETCHERS = map[string]int{
	"youdao": 1,
}

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	// contains filtered or unexported methods
}

type Result

type Result struct {
	Title    string
	SubTitle string
	Arg      string
}

type Translate

type Translate struct {
	Query   string
	Method  string
	Fetcher Fetcher
}

Translate translate query

func (*Translate) Execute

func (t *Translate) Execute() ([]Result, error)

type YouDaoFetcher

type YouDaoFetcher struct {
	AppKey    string
	AppSecret string
}

type YouDaoResult

type YouDaoResult struct {
	ErrorCode   string   `json:"errorCode"`
	Translation []string `json:"Translation"`
}

Jump to

Keyboard shortcuts

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