responsex

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_SUCCESS_CODE      = 0
	DEFAULT_ERROR_CODE        = 500
	DEFAULT_PARAMS_ERROR_CODE = 300
)

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, err error)

func OK

func OK(w http.ResponseWriter)

func OkJson

func OkJson(w http.ResponseWriter, resp interface{})

func Response

func Response(w http.ResponseWriter, code int, resp interface{}, err error)

Types

type Body

type Body struct {
	Code      int         `json:"code"`
	Msg       string      `json:"msg"`
	Data      interface{} `json:"data,omitempty"`
	Timestamp int64       `json:"timestamp,string"`
}

Jump to

Keyboard shortcuts

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