resp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

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

Response represents a http json response

func Fail

func Fail(ctx *gin.Context) *Response

Fail response with status code 400

func Forbidden

func Forbidden(ctx *gin.Context) *Response

Forbidden response with status code 403

func New

func New(ctx *gin.Context) *Response

func Ok

func Ok(ctx *gin.Context) *Response

Ok response with status code 200

func UnAuthorized

func UnAuthorized(ctx *gin.Context) *Response

UnAuthorized response with status code 401

func (*Response) Code

func (resp *Response) Code(code int) *Response

func (*Response) Data

func (resp *Response) Data(data any) *Response

func (*Response) Error

func (resp *Response) Error(err error) *Response

func (*Response) Msg

func (resp *Response) Msg(msg string) *Response

func (*Response) Render

func (resp *Response) Render()

func (*Response) Status

func (resp *Response) Status(status status.Status) *Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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