utils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_TIME_OUT_Second = 8
)

Variables

This section is empty.

Functions

func DoDeleteToOpenAPI added in v0.1.0

func DoDeleteToOpenAPI(apiDomain, apiPath, apiToken string) (retByte []byte, err error)

func DoPostFormToOpenAPI added in v0.1.0

func DoPostFormToOpenAPI(apiDomain, apiPath, apiToken string, dataBody string) (retByte []byte, err error)

func DoPostJsonToOpenAPI added in v0.1.0

func DoPostJsonToOpenAPI(apiDomain, apiPath, apiToken string, req interface{}) (retByte []byte, err error)

func DoPubToOpenAPI added in v0.1.0

func DoPubToOpenAPI(apiDomain, apiPath, apiToken string) (retByte []byte, err error)

func FormatDate

func FormatDate(date time.Time) string

FormatDate formats a date.

func FormatTimestamp2String

func FormatTimestamp2String(timestamp int64) string

func GetStringRuneN added in v0.1.2

func GetStringRuneN(textStr string, n int) (retText string)

截图字符串前N个字符内容

func JsonDecode added in v0.1.0

func JsonDecode(data string, inter interface{}) error

func JsonDecodeByte added in v0.1.0

func JsonDecodeByte(bytes []byte) map[string]interface{}

func JsonDecodeString added in v0.1.0

func JsonDecodeString(String string) map[string]interface{}

func JsonDecodeWithBytes added in v0.1.0

func JsonDecodeWithBytes(data []byte, inter interface{}) error

func JsonEncode added in v0.1.0

func JsonEncode(data interface{}) string

func JsonEncodeMapToByte added in v0.1.0

func JsonEncodeMapToByte(stringMap map[string]interface{}) []byte

func Remove added in v0.1.3

func Remove(name string) error

func StructToMap added in v0.1.0

func StructToMap(data interface{}) map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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