response

package
v0.0.0-...-ab2758e Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalServerError

func InternalServerError(c *fiber.Ctx, msg string) *restResponseError

InternalServerError creates a generic internal server error response

func NewRestResponseError

func NewRestResponseError(c *fiber.Ctx, re ResponseError) *restResponseError

NewRestResponseError creates an error to restResponseError and logs it

func NewRestResponseErrorWithCodeAndMsg

func NewRestResponseErrorWithCodeAndMsg(c *fiber.Ctx, code, msg string) *restResponseError

NewRestResponseErrorWithCodeAndMsg creates a new restResponseError

Types

type PaginationResponse

type PaginationResponse struct {
	PageNumber int `json:"pageNumber"`
	PageSize   int `json:"pageSize"`
	Total      int `json:"total"`
}

PaginationResponse represents pagination details

type ResponseError

type ResponseError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

ResponseError represents an error

type RestResponsePagination

type RestResponsePagination[T any] struct {
	Pagination PaginationResponse `json:"pagination"`
	Elements   []T                `json:"elements"`
}

RestResponsePagination represents a paginated response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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