rbody

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

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(action interface{}) macaron.Handler

Types

type ApiError

type ApiError struct {
	Code    int
	Message string
}

func (ApiError) Error

func (e ApiError) Error() string

type ApiResponse

type ApiResponse struct {
	Meta *ResponseMeta   `json:"meta"`
	Body json.RawMessage `json:"body"`
}

func ErrResp

func ErrResp(err error) *ApiResponse

func OkResp

func OkResp(t string, body interface{}) *ApiResponse

func (*ApiResponse) Error

func (r *ApiResponse) Error() error

type ResponseMeta

type ResponseMeta struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
}

Jump to

Keyboard shortcuts

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