web

package
v1.0.4-beta1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeOctetStream = "application/octet-stream"
	TypeForm        = "application/x-www-form-urlencoded"
	TypeJson        = "application/json"
	TypeXml         = "application/xml"
	TypeJpg         = "image/jpeg"
	TypePng         = "image/png"
)

Variables

This section is empty.

Functions

func CheckSign

func CheckSign(sign, appid, path, ts string) (ok bool)

func File

func File(c *gin.Context, fileBytes []byte, fileName, fileType string)

func JSON

func JSON(c *gin.Context, data interface{}, err error)

func Redirect

func Redirect(c *gin.Context, location string)

func VerifySign

func VerifySign(c *gin.Context)

VerifySign 验证Sign,签名规则,base64(md5(appid+path+ts))

Types

type Engine added in v1.0.2

type Engine struct {
	Gin *gin.Engine
	// contains filtered or unexported fields
}

func InitServer added in v1.0.2

func InitServer(port string) *Engine

func (*Engine) Start added in v1.0.2

func (e *Engine) Start()

type Pager

type Pager struct {
	PageNo   int `json:"page_no"`
	PageSize int `json:"page_size"`
}

func (Pager) Apply

func (p Pager) Apply(total int, data interface{}) interface{}

Jump to

Keyboard shortcuts

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