model

package
v0.0.0-...-0c811c1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceCrash = errors.New("micro service error")
)

error(s)

Functions

This section is empty.

Types

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"msg"`
	Data    interface{} `json:"data"`
	// contains filtered or unexported fields
}

Response Model

func NewResponse

func NewResponse(c echo.Context, code int) *Response

NewResponse Builder

func (*Response) Build

func (r *Response) Build(d interface{}) error

Build response

func (*Response) FreshJWT

func (r *Response) FreshJWT(jwt string) *Response

FreshJWT in header

func (*Response) MicroError

func (r *Response) MicroError(e error) *Response

MicroError Cleaner

func (*Response) Msg

func (r *Response) Msg(m string) *Response

Msg setter

Jump to

Keyboard shortcuts

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