gintool

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actions added in v1.1.3

func Actions(ctx *gin.Context) []string

初始化 Actions

func Download

func Download(ctx *gin.Context, fileUrl string, fileName string, remove bool)

Make A Downloader

func ParamFloat64 added in v1.2.6

func ParamFloat64(ctx *gin.Context, key string) (float64, bool)

小数型 float64 路由参数获取 ?id=123 返回 123, true ?id=a 返回 0, false

func ParamInt added in v1.1.2

func ParamInt(ctx *gin.Context, key string) (int, bool)

整数型 int Param 参数获取 路由定义 /:id 访问 /123 返回 123, true 路由定义 /:id 访问 /abc 返回 0, false

func ParamInt64 added in v1.2.6

func ParamInt64(ctx *gin.Context, key string) (int64, bool)

整数型 int64 Param 参数获取 路由定义 /:id 访问 /123 返回 123, true 路由定义 /:id 访问 /abc 返回 0, false

func PostFormFloat64 added in v1.2.7

func PostFormFloat64(ctx *gin.Context, key string) (float64, bool)

float64 浮点型 POST 数据获取

func PostFormInt added in v1.2.7

func PostFormInt(ctx *gin.Context, key string) (int, bool)

整数型 int POST 数据获取

func PostFormInt64 added in v1.2.7

func PostFormInt64(ctx *gin.Context, key string) (int64, bool)

整数型 int64 POST 数据获取

func QueryFloat64 added in v1.2.6

func QueryFloat64(ctx *gin.Context, key string) (float64, bool)

小数型 float64 url 参数获取 ?id=123 返回 123, true ?id=a 返回 0, false

func QueryInt

func QueryInt(ctx *gin.Context, key string) (int, bool)

整数型 int url 参数获取 ?id=123 返回 123, true ?id=a 返回 0, false

func QueryInt64 added in v1.2.6

func QueryInt64(ctx *gin.Context, key string) (int64, bool)

整数型 int64 url 参数获取 ?id=123 返回 123, true ?id=a 返回 0, false

func QueryPagerInit

func QueryPagerInit(ctx *gin.Context) (int, int, int)

初始化页码及每页展示数量

func SafeData added in v1.5.1

func SafeData(data string) string

字符串 过滤

func SafePOST added in v1.5.1

func SafePOST(ctx *gin.Context)

POST 过滤

func SafeQuery added in v1.5.1

func SafeQuery(ctx *gin.Context)

GET 过滤

func SafeRequest added in v1.6.3

func SafeRequest(ctx *gin.Context)

请求过滤

Types

type Upload added in v1.2.8

type Upload struct {
	FileName         string
	MaxSize          int64
	AllowExeNames    string
	ExtendName       string
	AllowTypes       string
	FileType         string
	TargetDir        string
	DirNamingRule    string
	FileNamingRule   string
	UploadedFilePath string
	SourceFile       *multipart.FileHeader
}

func (*Upload) Run added in v1.2.8

func (m *Upload) Run(ctx *gin.Context) (string, error)

Jump to

Keyboard shortcuts

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