libGin

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gin

func Gin(handler any) gin.HandlerFunc

func Respond

func Respond(code, status int, message string, data any, abort bool, ctx any)

Types

type GinModel

type GinModel struct {
	MessageDesc      map[string]string
	ErrorDesc        map[string]string
	RequestInterface libRequest.RequestInterface
}

func (GinModel) ErrorState added in v0.1.3

func (m GinModel) ErrorState(ctx any, err *response.ErrorState)

func (GinModel) GetErrorsArray

func (m GinModel) GetErrorsArray(message string, data any) []response.ErrorResponse

func (GinModel) HandleErrorState

func (m GinModel) HandleErrorState(err error, status int, message string, data any, ctx any)

func (GinModel) Respond

func (m GinModel) Respond(code, status int, message string, data any, abort bool, ctx any)

func (GinModel) RespondWithReceipt

func (m GinModel) RespondWithReceipt(code, status int, message string, data any, printData response.Receipt, abort bool, ctx any)

type GinParser

type GinParser struct {
	Ctx *gin.Context
}

func InitContext

func InitContext(c any) GinParser

func (GinParser) CheckUrlParam

func (c GinParser) CheckUrlParam(name string) (string, bool)

func (GinParser) GetArgs

func (c GinParser) GetArgs(args ...any) map[string]string

func (GinParser) GetBody

func (c GinParser) GetBody(target any) error

func (GinParser) GetHeader

func (c GinParser) GetHeader(target any) error

func (GinParser) GetHeaderValue

func (c GinParser) GetHeaderValue(name string) string

func (GinParser) GetHttpHeader

func (c GinParser) GetHttpHeader() http.Header

func (GinParser) GetLocal

func (c GinParser) GetLocal(name string) any

func (GinParser) GetLocalString

func (c GinParser) GetLocalString(name string) string

func (GinParser) GetMethod

func (c GinParser) GetMethod() string

func (GinParser) GetPath

func (c GinParser) GetPath() string

func (GinParser) GetRawUrlQuery

func (c GinParser) GetRawUrlQuery() string

func (GinParser) GetUrlParam

func (c GinParser) GetUrlParam(name string) string

func (GinParser) GetUrlParams

func (c GinParser) GetUrlParams() map[string]string

func (GinParser) GetUrlQuery

func (c GinParser) GetUrlQuery(target any) error

func (GinParser) ParseCommand

func (c GinParser) ParseCommand(command, title string, request libQuery.RecordData, parser libQuery.FieldParser) string

func (GinParser) SetLocal

func (c GinParser) SetLocal(name string, value any)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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