utils

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: GPL-3.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatusUnauthorized = errors.New("Unauthorized")

Functions

func Cors

func Cors() gin.HandlerFunc

处理跨域请求,支持options访问

func FormatTime added in v1.2.1

func FormatTime(date time.Time) string

func Get

func Get(url string, response interface{}, tlsConfig *tls.Config, setHeader func(req *http.Request) error) error

func GetByWebService

func GetByWebService(url string, response interface{}, tlsConfig *tls.Config, setHeader func(req *http.Request) error) error

func ParseTime added in v1.2.2

func ParseTime(str string) time.Time

func Post

func Post(url string, body io.Reader, response interface{}, tlsConfig *tls.Config, setHeader func(req *http.Request) error) error

func PostByWebService

func PostByWebService(url string, body io.Reader, response interface{}, tlsConfig *tls.Config, setHeader func(req *http.Request) error) error

func SetLogFileName

func SetLogFileName(name string)

func SetWriteLogFunc

func SetWriteLogFunc(w WriteLog)

Types

type IconFont added in v1.2.5

type IconFont struct {
	Key   string `json:"key"`
	Label string `json:"label"`
}

func GenIconFont added in v1.2.5

func GenIconFont(fileName string) []IconFont

type WriteLog

type WriteLog func(data []byte) error

Directories

Path Synopsis
log
example command

Jump to

Keyboard shortcuts

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