utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: GPL-3.0 Imports: 10 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 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 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 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