response

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(c fiber.Ctx, err string) error

Fail 操作失败

func Ok

func Ok(c fiber.Ctx) error

func OkWithData

func OkWithData(c fiber.Ctx, data interface{}) error

Types

type Response

type Response struct {
	Code  int         `json:"code"`  // 自定义错误码
	Msg   string      `json:"msg"`   // 给用户看的错误信息
	Data  interface{} `json:"data"`  // 返回的数据
	Error string      `json:"error"` // 给开发者看的详细错误信息
}

Jump to

Keyboard shortcuts

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