serialize

package
v0.0.0-...-b9d6e19 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode = iota
	FailCode
	ErrorCode
)

Variables

This section is empty.

Functions

func PutResponse

func PutResponse(resp *Response)

func SetCodeMessager

func SetCodeMessager(messager CodeMessager)

SetCodeMessager 设置一个CodeMessager,该函数可以从code获取message

Types

type CodeMessager

type CodeMessager func(int) string

type Response

type Response struct {
	HttpStatus int
	R          resResult
}

func Error

func Error(status int) *Response

func Fail

func Fail(code int) *Response

func FailData

func FailData(code int, data interface{}) *Response

func NewResponse

func NewResponse(status, code int, data interface{}, message string) *Response

func Ok

func Ok() *Response

func OkCode

func OkCode(code int) *Response

func OkCodeData

func OkCodeData(code int, data interface{}) *Response

func OkData

func OkData(data interface{}) *Response

Jump to

Keyboard shortcuts

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