adapt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GinHandlerFuncType = reflect.TypeOf(gin.HandlerFunc(nil))

Functions

This section is empty.

Types

type Adaptee

type Adaptee struct {
	Router Gin
	// contains filtered or unexported fields
}

func Adapt

func Adapt(router *gin.Engine, adapters ...interface{}) *Adaptee

func (*Adaptee) Any

func (a *Adaptee) Any(relativePath string, args ...interface{})

func (*Adaptee) DELETE

func (a *Adaptee) DELETE(relativePath string, args ...interface{})

func (*Adaptee) GET

func (a *Adaptee) GET(relativePath string, args ...interface{})

func (*Adaptee) Group

func (a *Adaptee) Group(relativePath string, args ...interface{}) *AdapteeGroup

func (*Adaptee) HEAD

func (a *Adaptee) HEAD(relativePath string, args ...interface{})

func (*Adaptee) OPTIONS

func (a *Adaptee) OPTIONS(relativePath string, args ...interface{})

func (*Adaptee) PATCH

func (a *Adaptee) PATCH(relativePath string, args ...interface{})

func (*Adaptee) POST

func (a *Adaptee) POST(relativePath string, args ...interface{})

func (*Adaptee) PUT

func (a *Adaptee) PUT(relativePath string, args ...interface{})

func (*Adaptee) RegisterAdapter

func (a *Adaptee) RegisterAdapter(adapter interface{})

func (*Adaptee) ServeHTTP

func (a *Adaptee) ServeHTTP(r http.ResponseWriter, w *http.Request)

func (*Adaptee) Use

func (a *Adaptee) Use(f func(c *gin.Context))

type AdapteeGroup

type AdapteeGroup struct {
	*Adaptee
	*gin.RouterGroup
}

func (*AdapteeGroup) Any

func (a *AdapteeGroup) Any(relativePath string, args ...interface{})

func (*AdapteeGroup) DELETE

func (a *AdapteeGroup) DELETE(relativePath string, args ...interface{})

func (*AdapteeGroup) GET

func (a *AdapteeGroup) GET(relativePath string, args ...interface{})

func (*AdapteeGroup) HEAD

func (a *AdapteeGroup) HEAD(relativePath string, args ...interface{})

func (*AdapteeGroup) OPTIONS

func (a *AdapteeGroup) OPTIONS(relativePath string, args ...interface{})

func (*AdapteeGroup) PATCH

func (a *AdapteeGroup) PATCH(relativePath string, args ...interface{})

func (*AdapteeGroup) POST

func (a *AdapteeGroup) POST(relativePath string, args ...interface{})

func (*AdapteeGroup) PUT

func (a *AdapteeGroup) PUT(relativePath string, args ...interface{})

func (*AdapteeGroup) Use

func (a *AdapteeGroup) Use(f func(c *gin.Context))

type Adapter

type Adapter interface {
	Adapt(relativePath string, arg interface{}) Handler
	Default(relativePath string) Handler
}

type Gin

type Gin interface {
	gin.IRouter
	http.Handler
}

type Handler

type Handler interface {
	Handle(*gin.Context)
}

Handler defines the handler used by gin middleware as return value.

type HandlerFunc

type HandlerFunc gin.HandlerFunc

func (HandlerFunc) Handle

func (h HandlerFunc) Handle(c *gin.Context)

type Handlers

type Handlers []Handler

func (Handlers) Handle

func (h Handlers) Handle(c *gin.Context)

type Middleware

type Middleware interface {
	Before(c *gin.Context) (after Handler)
}

type Middlewares

type Middlewares []Middleware

func (Middlewares) Before

func (s Middlewares) Before(c *gin.Context) (after Handler)

type Parent

type Parent interface {
	Parent() Adapter
}

Jump to

Keyboard shortcuts

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