responses

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(ctx *gin.Context, msg M, args ...interface{})

BadRequest have 3 args (message,data,extra)

func Conflict

func Conflict(ctx *gin.Context, msg M, args ...interface{})

Conflict have 3 args (message,data,extra)

func Created

func Created(ctx *gin.Context, msg M, args ...interface{})

Created have 3 args (message,data,extra)

func Forbidden

func Forbidden(ctx *gin.Context, msg M, args ...interface{})

Forbidden have 3 args (message,data,extra)

func Gone

func Gone(ctx *gin.Context, msg M, args ...interface{})

Gone have 3 args (message,data,extra)

func MethodNotAllowed

func MethodNotAllowed(ctx *gin.Context, msg M, args ...interface{})

MethodNotAllowed have 3 args (message,data,extra)

func NoContent

func NoContent(ctx *gin.Context, msg M, args ...interface{})

NoContent have 3 args (message,data,extra)

func NotAcceptable

func NotAcceptable(ctx *gin.Context, msg M, args ...interface{})

NotAcceptable have 3 args (message,data,extra)

func NotFound

func NotFound(ctx *gin.Context, msg M, args ...interface{})

NotFound have 3 args (message,data,extra)

func NotFoundOrBadRequest added in v1.0.1

func NotFoundOrBadRequest(ctx *gin.Context, msg M, args ...interface{})

func Ok

func Ok(ctx *gin.Context, msg M, args ...interface{})

Ok have 3 args (message,data,extra)

func PaymentRequired

func PaymentRequired(ctx *gin.Context, msg M, args ...interface{})

PaymentRequired have 3 args (message,data,extra)

func ProxyAuthRequired

func ProxyAuthRequired(ctx *gin.Context, msg M, args ...interface{})

ProxyAuthRequired have 3 args (message,data,extra)

func RequestTimeOut

func RequestTimeOut(ctx *gin.Context, msg M, args ...interface{})

RequestTimeOut have 3 args (message,data,extra)

func ToManyRequests

func ToManyRequests(ctx *gin.Context, msg M, args ...interface{})

ToManyRequests have 3 args (message,data,extra)

func Unauthorized

func Unauthorized(ctx *gin.Context, msg M, args ...interface{})

Unauthorized have 3 args (message,data,extra)

Types

type Data

type Data struct {
	Result     interface{} `json:"result"`
	Pagination interface{} `json:"pagination,omitempty"`
}

type M

type M struct {
	//C for code
	C string
	//M for message
	M string
	//E for errors
	E error
}

M for message

type Response

type Response struct {
	Code    string      `json:"code,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	Extra   interface{} `json:"extra,omitempty"`
	IsError bool        `json:"is_error"`
	Message string      `json:"message"`
	Status  int         `json:"status"`
}

func (Response) Byte added in v1.0.5

func (res Response) Byte() (b []byte)

func (Response) String added in v1.0.5

func (res Response) String() string

type Serialize added in v1.0.2

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

func NewSerialize added in v1.0.4

func NewSerialize(data interface{}, keys ...string) *Serialize

func (*Serialize) Exclude added in v1.0.4

func (s *Serialize) Exclude() interface{}

func (*Serialize) SetData added in v1.0.4

func (s *Serialize) SetData(data interface{})

func (*Serialize) SetKeys added in v1.0.4

func (s *Serialize) SetKeys(keys ...string)

Jump to

Keyboard shortcuts

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