utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadImage added in v0.20.1

func DownloadImage(url string, scale string, path string) (string, error)

DownloadImage download image with a specific scale, depend on ffmpeg

func Mail

func Mail(to []string, title string, content string) error

Mail send mail in HTML format

func OptimizeImage

func OptimizeImage(path string, scale string) (string, error)

OptimizeImage make image limited in a specific scaling

func SaveImage

func SaveImage(file File, scale string, path string) (string, error)

SaveImage save image with a specific scale, depend on ffmpeg

func WxDecrypt added in v0.24.0

func WxDecrypt(data []byte, platformKey string) ([]byte, error)

WxDecrypt 第三方平台消息解密

func WxEncrypt added in v0.24.0

func WxEncrypt(data []byte, platformKey, platformAppid string) ([]byte, error)

WxEncrypt 第三方平台消息加密

func WxSign added in v0.24.0

func WxSign(timestamp, nonce, encrypt, token string) string

WxSign 第三方平台签名

Types

type File

type File interface {
	io.Reader
	io.Seeker
}

File interface

type Graphql

type Graphql struct {
	URL       string
	Query     string
	Variables map[string]interface{}
	Operation string
	Headers   req.Header
}

Graphql struct

func (*Graphql) Fetch

func (g *Graphql) Fetch(ctx context.Context, result interface{}) error

Fetch execute a graphql api

type WxAPI added in v0.24.0

type WxAPI struct {
	Method  string
	URI     string
	Query   req.QueryParam
	Body    map[string]interface{}
	Headers req.Header
}

WxAPI struct

func (*WxAPI) Fetch added in v0.24.0

func (w *WxAPI) Fetch(ctx context.Context, result interface{}) error

Fetch execute a wx api

Jump to

Keyboard shortcuts

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