message

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(ctx Context, err error, data ...interface{})

func ErrBadRequest

func ErrBadRequest(ctx Context, err error, data ...interface{})

func ErrNotFound

func ErrNotFound(ctx Context, err error, data ...interface{})

func ErrUnauthorized

func ErrUnauthorized(ctx Context, err error, data ...interface{})

func Error

func Error(ctx Context, code int, err error, data ...interface{})

func Ok

func Ok(ctx Context, data ...interface{})

Types

type Context

type Context interface {
	JSON(code int, obj interface{})
	AbortWithStatusJSON(code int, jsonObj interface{})
}

type Response added in v0.0.2

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

func Msg

func Msg(data ...interface{}) Response

Jump to

Keyboard shortcuts

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