request

package
v0.0.0-...-bdedfc3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTranslation

func GetTranslation(c *gin.Context) (ut.Translator, error)

func GetValidator

func GetValidator(c *gin.Context) (*validator.Validate, error)

Types

type ResponseDTO

type ResponseDTO struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

func (ResponseDTO) Abort

func (r ResponseDTO) Abort(context *gin.Context)

type ResponseDataDto

type ResponseDataDto struct {
	ResponseDTO
	Data interface{} `json:"data"`
}

type ResponseErrorDto

type ResponseErrorDto struct {
	ResponseDTO
	Errors map[string]interface{} `json:"errors,omitempty"`
}

func DefaultGetValidParams

func DefaultGetValidParams(c *gin.Context, params interface{}) (ResponseErrorDto, error)

func HandleValidation

func HandleValidation(errs validator.ValidationErrors, trans ut.Translator) (ResponseErrorDto, error)

Jump to

Keyboard shortcuts

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