client

package
v0.0.0-...-a47dbcc Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeSHA256

func EncodeSHA256(text string) string

func PrintDaily

func PrintDaily()

Types

type Request

type Request struct {
	Q        string `json:"q"`
	From     string `json:"from"`
	To       string `json:"to"`
	AppKey   string `json:"appKey"`
	Salt     string `json:"salt"`
	Sign     string `json:"sign"`
	SignType string `json:"signType"`
	CurTime  int64  `json:"curtime"`
}

func NewRequest

func NewRequest(text string) *Request

func (*Request) Post

func (c *Request) Post() (Response, error)

type Response

type Response struct {
	ErrorCode   string   `json:"errorCode"`
	Query       string   `json:"query"`
	Translation []string `json:"translation"`
	Basic       string   `json:"basic"`
	Web         []web    `json:"web"`
}

func (*Response) PrintQuery

func (r *Response) PrintQuery()

func (*Response) PrintTranslate

func (r *Response) PrintTranslate()

func (*Response) PrintWeb

func (r *Response) PrintWeb()

Jump to

Keyboard shortcuts

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