echoadapter

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EchoAdapter

type EchoAdapter struct {
	// Instance holds the reference to the main Echo engine.
	// This is used when registering routes at the root level.
	Instance *echo.Echo
	// contains filtered or unexported fields
}

EchoAdapter is the implementation of the Transwarp interface for the Echo framework.

It serves as a bridge, translating standard net/http calls into Echo's specific context-based architecture.

func (*EchoAdapter) DELETE

func (a *EchoAdapter) DELETE(p string, h http.HandlerFunc)

func (*EchoAdapter) GET

func (a *EchoAdapter) GET(p string, h http.HandlerFunc)

func (*EchoAdapter) Group

func (a *EchoAdapter) Group(prefix string) internal.Router

Group creates a new sub-router with a specific path prefix.

It returns a new *EchoAdapter instance that points to the newly created Echo group, ensuring that subsequent calls to GET/POST/Use on the new instance are scoped to that group.

func (*EchoAdapter) HEAD

func (a *EchoAdapter) HEAD(p string, h http.HandlerFunc)

func (*EchoAdapter) Handle added in v1.0.2

func (a *EchoAdapter) Handle(pattern string, h http.Handler)

func (*EchoAdapter) HandleFunc added in v1.0.2

func (a *EchoAdapter) HandleFunc(pattern string, h http.HandlerFunc)

func (*EchoAdapter) PATCH

func (a *EchoAdapter) PATCH(p string, h http.HandlerFunc)

func (*EchoAdapter) POST

func (a *EchoAdapter) POST(p string, h http.HandlerFunc)

func (*EchoAdapter) PUT

func (a *EchoAdapter) PUT(p string, h http.HandlerFunc)

func (*EchoAdapter) Param

func (a *EchoAdapter) Param(r *http.Request, key string) string

Param retrieves a URL parameter value (e.g., /users/:id).

How it works: It looks into the http.Request context for the hidden *echo.Context (injected previously by 'handle' or 'Use'). If found, it delegates the parameter lookup to Echo.

func (*EchoAdapter) Serve

func (a *EchoAdapter) Serve(port string) error

Serve starts the HTTP server on the specified port.

func (*EchoAdapter) ServeHTTP added in v1.0.3

func (a *EchoAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*EchoAdapter) Use

func (a *EchoAdapter) Use(mw internal.Middleware)

Use registers a global or group-level middleware.

It adapts the standard 'func(http.Handler) http.Handler' signature into Echo's 'func(echo.HandlerFunc) echo.HandlerFunc' signature.

Jump to

Keyboard shortcuts

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