echo

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package echo provides rate limiting middleware for the Echo v4 web framework. It features IP spoofing protection with trusted proxy CIDR filtering and custom key extraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractClientIP

func ExtractClientIP(c echo.Context, trustedProxies []string) string

ExtractClientIP mengekstrak IP client secara aman dari Echo Context.

func New

func New(limiter *distlimit.Limiter, opts ...Option) echo.MiddlewareFunc

New mengembalikan Echo v4 Middleware Handler.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

type Option

type Option func(*Config)

func WithKeyFunc

func WithKeyFunc(fn func(c echo.Context) string) Option

WithKeyFunc kustomisasi fungsi penentuan key rate limit berdasarkan Echo Context.

func WithRouteLabeling added in v1.2.0

func WithRouteLabeling(enable bool) Option

WithRouteLabeling enables passing the Echo route path pattern (e.g. /api/v1/users/:id) as the route label in telemetry events.

func WithTrustedProxies

func WithTrustedProxies(proxies []string) Option

WithTrustedProxies menentukan daftar IP/CIDR proxy yang dipercayai untuk membaca X-Forwarded-For.

Jump to

Keyboard shortcuts

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