Skip to content

budisugianto/tollbooth_echo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

tollbooth_echo

Echo middleware for rate limiting HTTP requests.

Five Minutes Tutorial

package main

import (
	"time"

	"github.com/didip/tollbooth"
	"github.com/didip/tollbooth_echo"
	"github.com/labstack/echo"
	"github.com/labstack/echo/engine/standard"
)

func main() {
	e := echo.New()

	// Create a limiter struct.
	limiter := tollbooth.NewLimiter(1, time.Second, nil)

	e.Get("/", echo.HandlerFunc(func(c echo.Context) error {
		return c.String("Hello, World!", 200)
	}), tollbooth_echo.LimitHandler(limiter))

	e.Run(standard.New(":4444"))
}

About

Tollbooth - Echo integration layer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%