response

package
v0.6.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalServerError

func InternalServerError(message string, err error) mvc.Response

func NotFound

func NotFound(message string) mvc.Response

func Send

func Send(code int, message string, data interface{}) mvc.Response

func Success

func Success(message string, payload Payload) mvc.Response

Success 发送成功响应

func UnAuthenticated

func UnAuthenticated(message string) mvc.Response

UnAuthenticated 认证失败响应

func ValidationError

func ValidationError(message string) mvc.Response

Types

type Meta

type Meta struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
	Total int `json:"total"`
}

type Payload

type Payload map[string]interface{}

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
	Meta    *Meta       `json:"meta,omitempty"`
}

Jump to

Keyboard shortcuts

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