igin

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	*gin.Engine
}

func NewGinEngine

func NewGinEngine() Engine

func (*Engine) Run

func (ge *Engine) Run(addr string) error

type GinRouterAdapter

type GinRouterAdapter struct {
	*gin.Engine
}

func (*GinRouterAdapter) DELETE

func (gra *GinRouterAdapter) DELETE(relativePath string, handlers ...HandlerFunc)

func (*GinRouterAdapter) GET

func (gra *GinRouterAdapter) GET(relativePath string, handlers ...HandlerFunc)

func (*GinRouterAdapter) Group

func (gra *GinRouterAdapter) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup

func (*GinRouterAdapter) POST

func (gra *GinRouterAdapter) POST(relativePath string, handlers ...HandlerFunc)

func (*GinRouterAdapter) PUT

func (gra *GinRouterAdapter) PUT(relativePath string, handlers ...HandlerFunc)

func (*GinRouterAdapter) Static

func (gra *GinRouterAdapter) Static(relativePath, rootPath string)

type GinRouterGroupAdapter

type GinRouterGroupAdapter struct {
	*gin.RouterGroup
}

func (*GinRouterGroupAdapter) DELETE

func (grga *GinRouterGroupAdapter) DELETE(relativePath string, handlers ...HandlerFunc)

func (*GinRouterGroupAdapter) GET

func (grga *GinRouterGroupAdapter) GET(relativePath string, handlers ...HandlerFunc)

func (*GinRouterGroupAdapter) Group

func (grga *GinRouterGroupAdapter) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup

func (*GinRouterGroupAdapter) POST

func (grga *GinRouterGroupAdapter) POST(relativePath string, handlers ...HandlerFunc)

func (*GinRouterGroupAdapter) PUT

func (grga *GinRouterGroupAdapter) PUT(relativePath string, handlers ...HandlerFunc)

type HandlerFunc

type HandlerFunc func(c IContext)

type IContext

type IContext interface {
	JSON(code int, obj any)
	Param(key string) string
	BindJSON(v interface{}) error
	ShouldBindJSON(v interface{}) error
	ShouldBindQuery(v interface{}) error
	Get(key string) (value interface{}, exists bool)
	Set(key string, value interface{})
	Next()
	Request() *http.Request
	Writer() gin.ResponseWriter
	FullPath() string
	GetHeader(key string) string
	Query(key string) string
	Abort()
	Header(key, value string)
	Data(code int, contentType string, data []byte)
	String(code int, format string, values ...any)
	GetInt64(key string) int64
	FormFile(formName string) (*multipart.FileHeader, error)
	SaveUploadedFile(file *multipart.FileHeader, dst string) error
}

func NewGinContextAdapter

func NewGinContextAdapter(ctx *gin.Context) IContext

type IRouter

type IRouter interface {
	GET(relativePath string, handlers ...HandlerFunc)
	POST(relativePath string, handlers ...HandlerFunc)
	PUT(relativePath string, handlers ...HandlerFunc)
	DELETE(relativePath string, handlers ...HandlerFunc)
	Group(relativePath string, handlers ...HandlerFunc) IRouterGroup
	Static(relativePath, rootPath string)
}

func NewGinRouterAdapter

func NewGinRouterAdapter(engine *gin.Engine) IRouter

type IRouterGroup

type IRouterGroup interface {
	GET(relativePath string, handlers ...HandlerFunc)
	POST(relativePath string, handlers ...HandlerFunc)
	PUT(relativePath string, handlers ...HandlerFunc)
	DELETE(relativePath string, handlers ...HandlerFunc)
	Group(relativePath string, handlers ...HandlerFunc) IRouterGroup
}

Jump to

Keyboard shortcuts

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