resp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSuccess = "success"
	StatusFailure = "failure"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorMsg

type ErrorMsg struct {
	Errno  int
	Reason string
}

func BadRequestErr2Json

func BadRequestErr2Json(err error) *ErrorMsg

func Err2Json

func Err2Json(code int, err error) *ErrorMsg

func InternalServerErr2Json

func InternalServerErr2Json(err error) *ErrorMsg

func NotFoundErr2Json

func NotFoundErr2Json(err error) *ErrorMsg

type FailureResponse

type FailureResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

func Failure

func Failure(msg string) FailureResponse

type SuccessResponse

type SuccessResponse struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data,omitempty"`
}

func Success

func Success() SuccessResponse

func SuccessData

func SuccessData(data interface{}) SuccessResponse

Jump to

Keyboard shortcuts

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