core

package
v0.0.0-...-49bf833 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package core implements some core function used by api machinery

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteResponse

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

WriteResponse writes an error or response to the HTTP response body WriteResponse uses the errno.Decode method to extract the business error code and error message from the error based on the error type

Types

type ErrResponse

type ErrResponse struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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