web

package
v0.0.0-...-92c2bac Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToConfig

func BytesToConfig(imgBytes []byte) (image.Config, error)

获取 []byte图片的config

func BytesToImage

func BytesToImage(imgBytes []byte) (image.Image, error)

将 []byte 类型的图片数据转换为 image.Image 类型

func FileToConfig

func FileToConfig(path string) (image.Config, error)

返回本地文件的config

func FileToImage

func FileToImage(path string) (image.Image, error)

返回本地文件的img对象

func GetData

func GetData(url, ua string) (body []byte, err error)

快速获取

func GetRealURL

func GetRealURL(url string) (realurl string, err error)

GetRealURL 获取跳转后的链接

func ImageAnalysis

func ImageAnalysis(data string) (url string, con *image.Config)

解析base64等data

func NewDefaultClient

func NewDefaultClient() *http.Client

func RandUA

func RandUA() string

RandUA 随机 UA

func RequestDataWith

func RequestDataWith(client *http.Client, url, method, referer, ua string, body io.Reader) (data []byte, err error)

RequestDataWith 使用自定义请求头获取数据

func URLToConfig

func URLToConfig(url string) (image.Config, error)

返回url的config

func UpImgByte

func UpImgByte(file []byte) (url string, con *image.Config)

上传byte数据

func UpImgUrl

func UpImgUrl(imgurl string) (url string)

func UpImgfile

func UpImgfile(filePath string) (url string, con *image.Config)

上传file

func Web

func Web(client *http.Client, url, method string, setheaders func(*http.Request), body io.Reader) (data []byte, err error)

请求快捷包装

Types

This section is empty.

Jump to

Keyboard shortcuts

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