begincontext

package
v0.0.0-...-fe5c0f3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ErrHTTPCode = 599
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Code    grerrors.ErrorCode `json:"code"`
	Message string             `json:"message,omitempty"`
	Data    interface{}        `json:"data"`
}

type Context

type Context struct {
	gin.Context
	Parameters interface{}
}

func New

func New(ctx gin.Context) *Context

New create new context from gin's context

func (*Context) BindAndValidate

func (c *Context) BindAndValidate(i interface{}) grerrors.Error

BindAndValidate bind and validate form input then return error in human readable strings

func (*Context) BindJSONAndValidate

func (c *Context) BindJSONAndValidate(i interface{}) grerrors.Error

BindJSONAndValidate bind and validate json input then return error in human-readable strings

func (*Context) CreateResponseError

func (c *Context) CreateResponseError(vErr grerrors.Error)

func (*Context) CreateResponseSuccess

func (c *Context) CreateResponseSuccess(v interface{})

CreateResponseSuccess create default response from struct

type CustomBinder

type CustomBinder struct{}

Jump to

Keyboard shortcuts

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