Documentation
¶
Index ¶
- Constants
- func AddCookies(req *http.Request, cookies []*http.Cookie) *http.Request
- func IsChinese(str string) bool
- func NotReadResp(resp *http.Response, err error) (*http.Response, error)
- func PrintSource(name, fullname, source string)
- func ReadResp(resp *http.Response, err error) (*http.Response, []byte, error)
- func Register(t Translator)
- func SendRequest(method, urlStr string, body io.Reader, f func(*http.Request) error) (*http.Response, []byte, error)
- type Request
- type Response
- type Translator
Constants ¶
View Source
const ( // IconGood icon goog IconGood = "✔" // IconBad icon bad IconBad = "✗" // Logo logo Logo = ` ____ / __/_ __ / /_/ / / / / __/ /_/ / /_/ \__, / /____/ ` // Desc version and homepage Desc = ` version: %s homepage: https://github.com/xwjdsh/fy ` // CoffeeEmoji coffee emoji CoffeeEmoji = "\u2615\ufe0f" )
Variables ¶
This section is empty.
Functions ¶
func AddCookies ¶
AddCookies add cookies to http request
func NotReadResp ¶
NotReadResp dont read response, just closed it
Types ¶
type Request ¶
type Request struct {
// IsChinese whether the text is Chinese
IsChinese bool
// Text translate text
Text string
}
Request translate request
type Response ¶
type Response struct {
// FullName translator fullname
FullName string
// Result translate result
Result string
// Err translate error
Err error
}
Response translate response
Click to show internal directories.
Click to hide internal directories.
