controllers

package
v0.0.0-...-2926792 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AscJson

func AscJson(c *gin.Context)

使用AsciiJSON生成具有转义的非ASCII字符的json数据格式

func BasicAuth

func BasicAuth(c *gin.Context)

func BidUri

func BidUri(c *gin.Context)

给请求连接绑定URL参数 请求格式为 端口号/自定义名称/uuid(必须为uuid) 返回200

func BindParmStr

func BindParmStr(c *gin.Context)

struct绑定请求连接后的参数

func FileHtml

func FileHtml(c *gin.Context)

func FormHandler

func FormHandler(c *gin.Context)

绑定html复选框

func GetDataB

func GetDataB(c *gin.Context)

获取表单b的参数

func GetDataC

func GetDataC(this *gin.Context)

func GetDataD

func GetDataD(c *gin.Context)

func GetKeyValue

func GetKeyValue(c *gin.Context)

func GetMap

func GetMap(c *gin.Context)

映射请求地址后的map类型参数

func GetParam

func GetParam(c *gin.Context)

获取请求路径中的参数

func GetParam2

func GetParam2(c *gin.Context)

func IndexApi

func IndexApi(c *gin.Context)

func JsonP

func JsonP(c *gin.Context)

func LoandSync

func LoandSync(c *gin.Context)

func LoginEndpointV1

func LoginEndpointV1(c *gin.Context)

func LoginEndpointV2

func LoginEndpointV2(c *gin.Context)

func LoginForm

func LoginForm(c *gin.Context)

通过接收表单参数 模拟登录

func LoginJSON

func LoginJSON(c *gin.Context)

通过接收json参数 模型绑定参数 模拟登录

func LoginXML

func LoginXML(c *gin.Context)

接收xml数据格式 模拟登录

func LongAsync

func LongAsync(c *gin.Context)

Goroutines

func PureJSON

func PureJSON(c *gin.Context)

字符进行编码

func SetGetCookie

func SetGetCookie(c *gin.Context)

设置并获取cookie

func ShowHtmlIndex

func ShowHtmlIndex(c *gin.Context)

func ShowHtmlJSONP

func ShowHtmlJSONP(c *gin.Context)

func ShowTmplIndex

func ShowTmplIndex(c *gin.Context)

渲染模板 index.tmpl

func UploadFile

func UploadFile(c *gin.Context)

上传单个文件

func UploadFiles

func UploadFiles(c *gin.Context)

上传多个文件

func WelCome

func WelCome(c *gin.Context)

Types

type Login

type Login struct {
	User     string `form:"user" json:"user" xml:"user"  binding:"required"`
	Password string `form:"password" json:"password" xml:"password" binding:"required"`
}

type LoginForm2

type LoginForm2 struct {
	User     string `form:"user" binding:"required"`
	Password string `form:"password" binding:"required"`
}

type StructA

type StructA struct {
	FieldA string `form:"a"` // form 后的参数对应表单中输入框name属性
}

构造表单请求的参数

type StructB

type StructB struct {
	NestedStruct StructA
	FieldB       string `form:"b"`
}

type StructC

type StructC struct {
	NestedStructPointer *StructA
	FieldC              string `form:"c"`
}

type StructD

type StructD struct {
	NestedAnonyStruct struct {
		FieldX string `form:"x"`
	}
	FieldD string `form:"d"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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