core

package
v0.0.0-...-f5bcdd4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteResponse

func WriteResponse(c *gin.Context, err error, data interface{})

WriteResponse write an error or the response data into http response body. It use errors.ParseCoder to parse any error into errors.Coder errors.Coder contains error code, user-safe error message and http status code.

Types

type Response

type Response struct {
	StatusCode int    `json:"status_code"`
	StatusMsg  string `json:"status_msg,omitempty"`
}

ErrResponse defines the return messages when an error occurred. Reference will be omitted if it does not exist. swagger:model

Jump to

Keyboard shortcuts

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