gnext

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 10 Imported by: 0

README

gNext


The brilliant Gin Web Framework extension. Offers the API structuring, automates validation and generates documentation. It's fully compatible with the current Gin usages and Gin's middlewares.

Let's have a look at a base example.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFound = fmt.Errorf("resource not found")

Functions

This section is empty.

Types

type Body

type Body struct{}

func (Body) BodyDocs

func (m Body) BodyDocs()

type BodyInterface

type BodyInterface interface {
	BodyDocs()
}

type Error

type Error struct{}

func (Error) ErrorDocs

func (m Error) ErrorDocs()

type ErrorInterface

type ErrorInterface interface {
	ErrorDocs()
}

type HandlerCaller

type HandlerCaller struct {
	// contains filtered or unexported fields
}

func NewHandlerCaller

func NewHandlerCaller(receiver reflect.Value) *HandlerCaller

type HandlerWrapper

type HandlerWrapper struct {
	// contains filtered or unexported fields
}

func WrapHandler

func WrapHandler(method string, path string, middlewares []Middleware, documentation *docs.Docs, handler interface{}, doc ...*docs.PathDoc) *HandlerWrapper

type Headers

type Headers http.Header

func (Headers) HeadersDocs

func (m Headers) HeadersDocs()

type HeadersInterface

type HeadersInterface interface {
	HeadersDocs()
}

type IRouter

type IRouter interface {
	IRoutes
	Group(string, ...*docs.PathDoc) IRouter
}

type IRoutes

type IRoutes interface {
	Use(Middleware) IRoutes

	Handle(string, string, interface{}, ...*docs.PathDoc) IRoutes
	Any(string, interface{}, ...*docs.PathDoc) IRoutes
	GET(string, interface{}, ...*docs.PathDoc) IRoutes
	POST(string, interface{}, ...*docs.PathDoc) IRoutes
	DELETE(string, interface{}, ...*docs.PathDoc) IRoutes
	PATCH(string, interface{}, ...*docs.PathDoc) IRoutes
	PUT(string, interface{}, ...*docs.PathDoc) IRoutes
	OPTIONS(string, interface{}, ...*docs.PathDoc) IRoutes
	HEAD(string, interface{}, ...*docs.PathDoc) IRoutes
}

type Middleware

type Middleware struct {
	Before interface{}
	After  interface{}
}

type MiddlewareFactory

type MiddlewareFactory func() Middleware

type Query

type Query struct{}

func (Query) QueryDocs

func (m Query) QueryDocs()

type QueryInterface

type QueryInterface interface {
	QueryDocs()
}

type Response

type Response struct{}

func (Response) ResponseDocs

func (m Response) ResponseDocs()

type ResponseInterface

type ResponseInterface interface {
	ResponseDocs()
}

type Router

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

func New

func New(documentation *docs.Docs) *Router

func (*Router) Any

func (g *Router) Any(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) DELETE

func (g *Router) DELETE(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) Engine

func (r *Router) Engine() http.Handler

func (*Router) GET

func (g *Router) GET(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) Group

func (g *Router) Group(prefix string, _ ...*docs.PathDoc) IRouter

func (*Router) HEAD

func (g *Router) HEAD(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) Handle

func (g *Router) Handle(method string, path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) OPTIONS

func (g *Router) OPTIONS(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) PATCH

func (g *Router) PATCH(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) POST

func (g *Router) POST(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) PUT

func (g *Router) PUT(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes

func (*Router) RawRouter

func (g *Router) RawRouter() gin.IRouter

func (*Router) Run

func (r *Router) Run(addr string) error

func (*Router) Use

func (g *Router) Use(middleware Middleware) IRoutes

type Status

type Status int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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