exgin

package module
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: Apache-2.0 Imports: 21 Imported by: 2

README

ExGin

go get -u github.com/ergoapi/exgin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(c *gin.Context, ptr interface{})

func ExCors

func ExCors() gin.HandlerFunc

ExCors excors middleware

func ExLog added in v1.0.3

func ExLog(skip ...string) gin.HandlerFunc

ExLog ex logrus middleware

func ExRecovery added in v1.0.4

func ExRecovery() gin.HandlerFunc

ExRecovery logrus recovery

func ExTraceID added in v1.3.0

func ExTraceID() gin.HandlerFunc

func GinsAbort

func GinsAbort(c *gin.Context, msg string, args ...interface{})

func GinsAbortWithCode added in v1.0.2

func GinsAbortWithCode(c *gin.Context, respcode int, msg string, args ...interface{})

func GinsCodeData added in v1.0.5

func GinsCodeData(c *gin.Context, code int, data interface{}, err error)

func GinsCustomCodeResp added in v1.0.5

func GinsCustomCodeResp(c *gin.Context, code int, obj interface{})

func GinsCustomResp added in v1.0.3

func GinsCustomResp(c *gin.Context, obj interface{})

func GinsData

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

func GinsErrorData added in v1.0.5

func GinsErrorData(c *gin.Context, code int, data interface{}, err error)

func GinsHeader

func GinsHeader(c *gin.Context, headerkey string) string

GinsHeader header key

func GinsOffset

func GinsOffset(c *gin.Context, limit int) int

GinsOffset offset

func GinsParamInt

func GinsParamInt(c *gin.Context, field string) int

GinsParamInt param str

func GinsParamInt64

func GinsParamInt64(c *gin.Context, field string) int64

GinsParamInt64 param str

func GinsParamStr

func GinsParamStr(c *gin.Context, field string) string

GinsParamStr param str

func GinsQueryBool

func GinsQueryBool(c *gin.Context, key string, defaultVal ...bool) bool

GinsQueryBool query bool

func GinsQueryInt

func GinsQueryInt(c *gin.Context, key string, defaultVal ...int) int

GinsQueryInt query int

func GinsQueryInt64

func GinsQueryInt64(c *gin.Context, key string, defaultVal ...int64) int64

GinsQueryInt64 querry int64

func GinsQueryStr

func GinsQueryStr(c *gin.Context, key string, defaultval ...string) string

GinsQueryStr query string

func GinsQueryStrNull

func GinsQueryStrNull(c *gin.Context, key string) string

GinsQueryStrNull query string

func Host added in v1.0.8

func Host(c *gin.Context) string

func Init

func Init(c *Config) *gin.Engine

Init init gin engine

func RealIP added in v1.0.3

func RealIP(c *gin.Context) string

Types

type APICustomRespBody added in v1.3.0

type APICustomRespBody struct {
	Code      int         `json:"code"`
	Data      interface{} `json:"data"`
	Message   string      `json:"message"`
	Timestamp int         `json:"timestamp"`
}

APICustomRespBody swag api resp body

type Config added in v1.1.0

type Config struct {
	Debug       bool
	Gops        bool
	GopsPath    string
	Pprof       bool
	PprofPath   string
	Cors        bool
	Metrics     bool
	MetricsPath string
}

func (*Config) GinSet added in v1.1.0

func (c *Config) GinSet(r *gin.Engine)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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