echo

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package echo provides adapters for using err-envelope with Echo framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trace

Trace adapts err-envelope trace middleware to Echo's middleware interface.

This generates or propagates trace IDs and makes them available via errenvelope.TraceIDFromRequest(c.Request()).

Example:

e := echo.New()
e.Use(Trace)
e.GET("/user", func(c echo.Context) error {
    traceID := errenvelope.TraceIDFromRequest(c.Request())
    // ...
    return nil
})

func Write

func Write(c echofw.Context, err error) error

Write sends a structured error response using err-envelope format.

This is a convenience wrapper that extracts c.Response().Writer and c.Request() to call errenvelope.Write.

Example:

e.GET("/user", func(c echo.Context) error {
    if userID == "" {
        return Write(c, errenvelope.BadRequest("Missing user ID"))
    }
    // ...
    return nil
})

Types

This section is empty.

Jump to

Keyboard shortcuts

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