handler

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallService

func CallService(_ context.Context, code int) error

CallService - simulate service / repo layer error.

func CreateUser

func CreateUser(svc *service.Service) echo.HandlerFunc

CreateUser for create single user based on json body.

func EmitError

func EmitError(c echo.Context) error

EmitError helps to build echo non 2xx error response GET /error/:code.

func ErrorHandler

func ErrorHandler(err error, ctx echo.Context)

ErrorHandler is fallback exception handler when controller / handler returning error instead of ctx.JSON / echo.NewHTTPError.

func GetUser

func GetUser(svc *service.Service) echo.HandlerFunc

GetUser find user by specific id GET /users/:id.

func HealthCheck

func HealthCheck(db *repository.DummyDB) echokit.HealthCheckFunc

HealthCheck health check handler.

func LongOperation

func LongOperation(ctx echo.Context) error

LongOperation simulates long query / api call.

func PanicGuaranteed

func PanicGuaranteed(c echo.Context) error

PanicGuaranteed demonstrates what could go wrong during executing handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

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