utils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPError

func NewHTTPError(ctx *fiber.Ctx, status int, err interface{}) error

func ParseBody

func ParseBody(ctx *fiber.Ctx, body interface{}) *fiber.Error

ParseBody is helper function for parsing the body. Is any error occurs it will panic. Its just a helper function to avoid writing if condition again n again.

func ParseBodyAndValidate

func ParseBodyAndValidate(ctx *fiber.Ctx, body interface{}) *fiber.Error

ParseBodyAndValidate is helper function for parsing the body. Is any error occurs it will panic. Its just a helper function to avoid writing if condition again n again.

func Validate

func Validate(payload interface{}) *fiber.Error

Validate validates the input struct

Types

type HTTPError

type HTTPError struct {
	Code    int    `json:"code" example:"400"`
	Message string `json:"message" example:"error"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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