infrafiber

package
v0.0.0-...-b62d7c7 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithError

func WithError(err error) func(*Response) *Response

func WithHttpCode

func WithHttpCode(httpCode int) func(*Response) *Response

func WithMessage

func WithMessage(message string) func(*Response) *Response

func WithPayload

func WithPayload(payload interface{}) func(*Response) *Response

func WithQuery

func WithQuery(query interface{}) func(*Response) *Response

Types

type Response

type Response struct {
	HttpCode  int         `json:"-"`
	Success   bool        `json:"success"`
	Message   string      `json:"message"`
	Payload   interface{} `json:"payload,omitempty"`
	Query     interface{} `json:"query,omitempty"`
	Error     string      `json:"error,omitempty"`
	ErrorCode string      `json:"error_code,omitempty"`
}

func NewResponse

func NewResponse(params ...func(*Response) *Response) Response

func (Response) Send

func (r Response) Send(ctx *fiber.Ctx) error

Jump to

Keyboard shortcuts

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