ginext

package
v0.0.172 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsMiddleware

func CorsMiddleware() gin.HandlerFunc

func RedirectFound

func RedirectFound(newuri string) gin.HandlerFunc

func RedirectPermanent

func RedirectPermanent(newuri string) gin.HandlerFunc

func RedirectTemporary

func RedirectTemporary(newuri string) gin.HandlerFunc

func Wrap

Types

type GinRouteBuilder

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

func (*GinRouteBuilder) Handle

func (w *GinRouteBuilder) Handle(handler WHandlerFunc)

func (*GinRouteBuilder) Use

func (w *GinRouteBuilder) Use(middleware gin.HandlerFunc) *GinRouteBuilder

type GinRoutesWrapper

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

func (*GinRoutesWrapper) COUNT

func (w *GinRoutesWrapper) COUNT(relativePath string) *GinRouteBuilder

func (*GinRoutesWrapper) DELETE

func (w *GinRoutesWrapper) DELETE(relativePath string) *GinRouteBuilder

func (*GinRoutesWrapper) GET

func (w *GinRoutesWrapper) GET(relativePath string) *GinRouteBuilder

func (*GinRoutesWrapper) Group

func (w *GinRoutesWrapper) Group(relativePath string) *GinRoutesWrapper

func (*GinRoutesWrapper) HEAD

func (w *GinRoutesWrapper) HEAD(relativePath string) *GinRouteBuilder

func (*GinRoutesWrapper) OPTIONS

func (w *GinRoutesWrapper) OPTIONS(relativePath string) *GinRouteBuilder

func (*GinRoutesWrapper) PATCH

func (w *GinRoutesWrapper) PATCH(relativePath string) *GinRouteBuilder

func (*GinRoutesWrapper) POST

func (w *GinRoutesWrapper) POST(relativePath string) *GinRouteBuilder

func (*GinRoutesWrapper) PUT

func (w *GinRoutesWrapper) PUT(relativePath string) *GinRouteBuilder

type GinWrapper

type GinWrapper struct {
	SuppressGinLogs bool
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(allowCors bool, ginDebug bool, returnRawErrors bool) *GinWrapper

func (*GinWrapper) Routes

func (w *GinWrapper) Routes() *GinRoutesWrapper

type HTTPResponse

type HTTPResponse interface {
	Write(g *gin.Context)
}

func APIError

func APIError(g *gin.Context, errcode apierr.APIErrorCode, msg string, e error) HTTPResponse

func Data

func Data(sc int, contentType string, data []byte) HTTPResponse

func Download

func Download(mimetype string, filepath string, filename string) HTTPResponse

func File

func File(mimetype string, filepath string) HTTPResponse

func JSON

func JSON(sc int, data any) HTTPResponse

func NotImplemented

func NotImplemented(g *gin.Context) HTTPResponse

func Status

func Status(sc int) HTTPResponse

func Text

func Text(sc int, data string) HTTPResponse

type WHandlerFunc

type WHandlerFunc func(*gin.Context) HTTPResponse

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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