utils

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

* @Author: SpenserCai * @Date: 2023-08-17 00:40:47 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-24 00:43:58 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-17 00:30:18 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-25 20:57:31 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-17 00:38:37 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-17 00:40:30 * @Description: file content

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBase64ToBytes

func ConvertBase64ToBytes(base64Str string) ([]byte, error)

func ConvertBytesToBase64

func ConvertBytesToBase64(data []byte) string

func FormatCommand

func FormatCommand(cmdName string) string

如果name中有_则用下划线分割后每个首字母专大写,如果没有_则直接首字母转大写

func GetImageBase64

func GetImageBase64(url string) (string, error)

func GetImageBytesFromUrl

func GetImageBytesFromUrl(url string) ([]byte, error)

func GetImageReaderByBase64

func GetImageReaderByBase64(b64 string) (*bytes.Reader, error)

func GetImageSizeFromBase64 added in v0.5.3

func GetImageSizeFromBase64(base64Str string) (int, int, error)

func GetJsonReaderByJsonString added in v0.4.1

func GetJsonReaderByJsonString(jsonStr string) (*strings.Reader, error)

func IsJsonString added in v0.2.2

func IsJsonString(str string) bool

判断字符串是否是json字符串

func IsUrl

func IsUrl(str string) bool

func IsZeroValue added in v0.3.0

func IsZeroValue(value interface{}) bool

func MergeImageFromBase64 added in v0.8.2

func MergeImageFromBase64(base64List []string) (string, error)

图片合并

func ResizeImage added in v0.9.2

func ResizeImage(inputImage image.Image, scalePercent float64) (image.Image, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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