response

package
v0.0.0-...-36ab9e0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MessageSuccess = "Success"

Functions

func New400Response

func New400Response(msg string, args ...interface{}) error

func New500Response

func New500Response(msg string, args ...interface{}) error

func NewResponse

func NewResponse(code, status int, msg string, args ...interface{}) error

func Wrap400Response

func Wrap400Response(err error, msg string, args ...interface{}) error

func Wrap500Response

func Wrap500Response(err error, msg string, args ...interface{}) error

func WrapResponse

func WrapResponse(err error, code, status int, msg string, args ...interface{}) error

Types

type Response

type Response struct {
	Code       int         `json:"code"`
	Message    string      `json:"message"`
	StatusCode int         `json:"status_code"`
	Data       interface{} `json:"data"`
}

type ResponseError

type ResponseError struct {
	Code       int    `json:"code"`
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`
	ERR        error
}

func UnWrapResponse

func UnWrapResponse(err error) *ResponseError

func (*ResponseError) Error

func (r *ResponseError) Error() string

Jump to

Keyboard shortcuts

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