result

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OK            = Result{Code: "0", Msg: "ok", HttpStatus: 200}
	InternalError = Result{Code: "-1", Msg: "internal error", HttpStatus: 500}
	ConnectError  = Result{Code: "1001", Msg: "connect error", HttpStatus: 500}
)

Functions

This section is empty.

Types

type Result

type Result struct {
	Code string      `json:"code"`
	Msg  string      `json:"message"`
	Data interface{} `json:"data,omitempty"`

	HttpStatus int `json:"-"`
}

func Ok

func Ok(data interface{}) Result

func (*Result) WriteJson

func (result *Result) WriteJson(ctx *gin.Context)

Jump to

Keyboard shortcuts

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