mqiniu

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete added in v0.0.30

func Delete(access string, secret string, bucket string, fileKey string) error

func GetDownloadURL

func GetDownloadURL(access string, secret string, domain string, fileKey string, deadline int64) string

GetDownloadURL 获取私有下载链接

func Upload

func Upload(ctx context.Context, access string, secret string, zone *storage.Zone, bucket string, fileKey string, bs []byte) error

Upload 上传到qiniu

func UploadImg

func UploadImg(ctx context.Context, access string, secret string, bucket string, fileKey string, img image.Image) error

UploadImg 上传到qiniu

func UploadToken

func UploadToken(access string, secret string, bucket string) string

UploadToken 获取上传token

Types

type StRespImageCensor added in v0.0.28

type StRespImageCensor struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Error   string `json:"error"`
	EntryID string `json:"entry_id"`
	Result  struct {
		Suggestion string `json:"suggestion"`
		Scenes     struct {
			Ads struct {
				Suggestion string `json:"suggestion"`
				Details    []struct {
					Suggestion string  `json:"suggestion"`
					Label      string  `json:"label"`
					Score      float64 `json:"score"`
				} `json:"details"`
			} `json:"ads"`
			Politician struct {
				Suggestion string `json:"suggestion"`
				Details    []struct {
					Suggestion string  `json:"suggestion"`
					Label      string  `json:"label"`
					Score      float64 `json:"score"`
				} `json:"details"`
			} `json:"politician"`
			Pulp struct {
				Suggestion string `json:"suggestion"`
				Details    []struct {
					Suggestion string  `json:"suggestion"`
					Label      string  `json:"label"`
					Score      float64 `json:"score"`
				} `json:"details"`
			} `json:"pulp"`
			Terror struct {
				Suggestion string `json:"suggestion"`
				Details    []struct {
					Suggestion string  `json:"suggestion"`
					Label      string  `json:"label"`
					Score      float64 `json:"score"`
				} `json:"details"`
			} `json:"terror"`
		} `json:"scenes"`
	} `json:"result"`
}

func ImageCensor added in v0.0.28

func ImageCensor(access string, secret string, uri string) (*StRespImageCensor, error)

ImageCensor 脏字过滤

type StRespTextCensor added in v0.0.28

type StRespTextCensor struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Error   string `json:"error"`
	Result  struct {
		Suggestion string `json:"suggestion"`
		Scenes     struct {
			Antispam struct {
				Suggestion string `json:"suggestion"`
				Details    []struct {
					Label string  `json:"label"`
					Score float64 `json:"score"`
				} `json:"details"`
			} `json:"antispam"`
		} `json:"scenes"`
	} `json:"result"`
}

func TextCensor added in v0.0.28

func TextCensor(access string, secret string, text string) (*StRespTextCensor, error)

TextCensor 脏字过滤

Jump to

Keyboard shortcuts

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