response

package
v0.0.0-...-0d658de Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Status int
	Data   any
	// contains filtered or unexported fields
}

func Ctx

func Ctx(ctx *fiber.Ctx) *Response

func (*Response) Result

func (r *Response) Result(response *Result) error

type Result

type Result struct {
	Status  int    `json:"status"`
	Data    any    `json:"data"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

func Error

func Error(status int, code, message string) *Result

func ErrorDefault

func ErrorDefault(code string) *Result

func Success

func Success(status int, data ...any) *Result

func (*Result) Error

func (r *Result) Error() (Status int, Code string, Message string)

func (*Result) Success

func (r *Result) Success() (Status int, Data any)

Jump to

Keyboard shortcuts

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