util

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProxyOpen bool
View Source
var ProxyURL string

Functions

func ClearOrmCache added in v1.1.6

func ClearOrmCache(ctx context.Context, key string)

清理orm缓存

func GetConfig added in v1.1.6

func GetConfig(v ...interface{}) string

配置信息

func GetMySQLVersion added in v1.1.6

func GetMySQLVersion() string

GetMySQLVersion

@Description: 获取mysql版本
@return string

func GetProxy

func GetProxy(ctx context.Context) func(*http.Request) (*url.URL, error)

func GetProxyTransport

func GetProxyTransport(ctx context.Context) *http.Transport

func GetValueOrDefault added in v1.1.6

func GetValueOrDefault(value interface{}) bool

GetValueOrDefault

@Description: 给定一个interface,如果是nil或空,则返回false
@param value
@param defaultValue
@return interface{}

func GetVersions added in v1.1.6

func GetVersions(name string) interface{}

获取版本

func HttpDownloadFile

func HttpDownloadFile(ctx context.Context, fileURL string, useProxy ...bool) []byte

func HttpGet

func HttpGet(ctx context.Context, url string, header map[string]string, data interface{}, result interface{}, cookies ...map[string]string) error

func HttpPost

func HttpPost(ctx context.Context, url string, header map[string]string, data, result interface{}) error

HttpPost

@Description: post请求
@param ctx
@param url
@param header
@param data 发送的参数
@param result 返回的数据
@return error

func HttpPostResult

func HttpPostResult(ctx context.Context, url string, header map[string]string, data, result interface{}) (res interface{}, err error)

返回结果

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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