rest

package
v0.0.0-...-733d789 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(ctx *fiber.Ctx, err error) error

func NotFoundMiddleWare

func NotFoundMiddleWare(ctx *fiber.Ctx) error

func SendDataResponse

func SendDataResponse(ctx *fiber.Ctx, data interface{})

func SendEndpointNotFoundResponse

func SendEndpointNotFoundResponse(ctx *fiber.Ctx)

func SendInternalServerErrorReponse

func SendInternalServerErrorReponse(ctx *fiber.Ctx, err error)

func SendMessageResponse

func SendMessageResponse(ctx *fiber.Ctx, code int, message string)

func SendResourceAlreadyExistsResponse

func SendResourceAlreadyExistsResponse(ctx *fiber.Ctx)

func SendResourceNotFoundResponse

func SendResourceNotFoundResponse(ctx *fiber.Ctx)

func SendUnsupportedMethodResponse

func SendUnsupportedMethodResponse(ctx *fiber.Ctx)

Types

type Config

type Config struct {
	BindAddress string `json:"bind_addr"`
	BindPort    uint16 `json:"bind_port"`
}

type JsonResponse

type JsonResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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