response

package
v0.0.0-...-ac5fab8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Meta  *pagination.Paginator `json:"meta,omitempty"`
	Item  interface{}           `json:"item"`
	Items interface{}           `json:"items"`
}

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func InternalServerError

func InternalServerError(message string, err error) Response

func NotFound

func NotFound(message string) Response

func Send

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

func Success

func Success(message string, data interface{}, meta *pagination.Paginator) Response

Success 发送成功响应

func UnAuthenticated

func UnAuthenticated(message string) Response

UnAuthenticated 认证失败响应

func ValidationError

func ValidationError(message string, err error) Response

Jump to

Keyboard shortcuts

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