utils

package
v0.0.0-...-544fd76 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayStringDiff

func ArrayStringDiff(a []string, b []string, args ...[]string) []string

func Failed

func Failed(c *gin.Context, status_code int, message string, data interface{})

func HttpGet

func HttpGet(url string) (string, error)

func InetAton

func InetAton(ip string) int64

Convert net.IP to int64 , http://www.outofmemory.cn

func InetNtoa

func InetNtoa(ipnr int64) net.IP

func IntToString

func IntToString(num int) string

Int 转 String

func MathPlus

func MathPlus(a int, b int) int

加法

func MathReduce

func MathReduce(a int, b int) int

减法

func Success

func Success(c *gin.Context, data interface{})

func Throw403

func Throw403(c *gin.Context, message string)

func TimeFormat

func TimeFormat(time time.Time, layout string) string

func TimeToDateStr

func TimeToDateStr(time time.Time) string

获取日期

func TrimHtmlTag

func TrimHtmlTag(src string) string

func UrlEncode

func UrlEncode(data map[string]string) string

Types

type HC

type HC struct {
	Client *http.Client
}
var HttpClient *HC

func MakeHttpClient

func MakeHttpClient() *HC

func (*HC) HttpDelete

func (httpClient *HC) HttpDelete(url string, headers map[string]string) ([]byte, error)

func (*HC) HttpGet

func (httpClient *HC) HttpGet(url string, headers map[string]string) ([]byte, error)

func (*HC) HttpPost

func (httpClient *HC) HttpPost(url string, data interface{}, headers map[string]string) ([]byte, error)

type Page

type Page interface {
}

type Pagination

type Pagination struct {
	// contains filtered or unexported fields
}

func MakePagination

func MakePagination(request *http.Request, total int, size int) *Pagination

func (*Pagination) Paginate

func (page *Pagination) Paginate() []map[string]string

生成分页

Jump to

Keyboard shortcuts

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