transhelper

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaiduFanyiResponse

type BaiduFanyiResponse struct {
	Result struct {
		From        string `json:"from"`
		TransResult []struct {
			Dst string `json:"dst"`
			Src string `json:"src"`
		} `json:"trans_result"`
		To string `json:"to"`
	} `json:"result"`
	ErrorMsg  string `json:"error_msg"`
	ErrorCode int    `json:"error_code"`
}

type FaceFusionRequest

type FaceFusionRequest struct {
	ImageTemplate struct {
		Image     string `json:"image"`
		ImageType string `json:"image_type"`
	} `json:"image_template"`
	ImageTarget struct {
		Image     string `json:"image"`
		ImageType string `json:"image_type"`
	} `json:"image_target"`
	Version string `json:"version"`
}

type FaceFusionResponse

type FaceFusionResponse struct {
	Result struct {
		MergeImage string `json:"merge_image"`
	} `json:"result"`
	ErrorMsg  string `json:"error_msg"`
	ErrorCode int    `json:"error_code"`
}

type SpiderBaiduFanyi

type SpiderBaiduFanyi struct {
	ApiKey    string `json:"api_key"`
	SecretKey string `json:"secret_key"`
}

SpiderBaiduFanyi 基于百度的翻译爬虫

func NewBaiduFanyiSpider

func NewBaiduFanyiSpider() *SpiderBaiduFanyi

func (*SpiderBaiduFanyi) GetAccessToken

func (s *SpiderBaiduFanyi) GetAccessToken() string

func (*SpiderBaiduFanyi) ToEN

func (s *SpiderBaiduFanyi) ToEN(msg string) (string, error)

ToEn

func (*SpiderBaiduFanyi) ToFace

func (s *SpiderBaiduFanyi) ToFace(imageTemplatePath, imageTargetPath io.Reader) (ff FaceFusionResponse, err error)

Jump to

Keyboard shortcuts

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