http

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogAndRespondWithError

func LogAndRespondWithError(logger logrus.FieldLogger, err error, errorMessage string, statusCode int) error

LogAndRespondWithError logs the error and returns an HTTP error.

func ParseRequestBodyToStruct

func ParseRequestBodyToStruct(ctx echo.Context, targetStruct interface{}) error

ParseRequestBodyToStruct parses json bytes into a struct

func RespondWithoutBody

func RespondWithoutBody(ctx echo.Context, code int) error

RespondWithoutBody wraps error echo bodiless responses.

func WriteResponse

func WriteResponse(ctx echo.Context, code int, body interface{}) error

WriteResponse parses a struct into a json and writes in the response

Types

This section is empty.

Jump to

Keyboard shortcuts

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