utils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCache

func DeleteCache(key string)

func DriverDigitFunc

func DriverDigitFunc() (id, b64s string, err error)

纯数字验证码

func DriverStringFunc

func DriverStringFunc() (id, b64s string, err error)

字符串验证码 [数字+字母]

func Fetch

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

get 请求

func FormatPager

func FormatPager(page, size string) (int, int)

格式化 页码和页容量

func GetCache

func GetCache(key string) (interface{}, bool)

func GetGuid

func GetGuid() string

生成一个GUID

func GetLocation

func GetLocation(ip string) string

func GetRequest

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

get 请求

func GetUUID added in v0.0.2

func GetUUID() uuid.UUID

生成一个UUID

func PageHtml

func PageHtml(url string, page, size, count int) string

func PageWebHtml

func PageWebHtml(url string, page, size, count int) string

func PostRequest

func PostRequest(url, parameter string) ([]byte, error)

post 请求

func RandomInt

func RandomInt(n int) string

func RandomString

func RandomString(n int) string

func RemoveDuplicateElement added in v0.0.4

func RemoveDuplicateElement(items []string) []string

Slice去重

func SetCache

func SetCache(key string, data interface{}, timeout int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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