Events middleware for tango
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Lunny Xiao 2906df98f8
continuous-integration/drone/push Build is passing Details
use go mod and moved to gitea.com
3 years ago
.drone.yml use go mod and moved to gitea.com 3 years ago
LICENSE license 8 years ago
README.md use go mod and moved to gitea.com 3 years ago
circle.yml update CI config 6 years ago
events.go migrate to gitea.com/lunny/tango 4 years ago
events_test.go migrate to gitea.com/lunny/tango 4 years ago
go.mod use go mod and moved to gitea.com 3 years ago
go.sum use go mod and moved to gitea.com 3 years ago

README.md

events Build Status

Middleware events is an event middleware for Tango.

Installation

go get gitea.com/tango/events

Simple Example

type EventAction struct {
    tango.Ctx
}

func (c *EventAction) Get() {
    c.Write([]byte("get"))
}

func (c *EventAction) Before() {
    c.Write([]byte("before "))
}

func (c *EventAction) After() {
    c.Write([]byte(" after"))
}

func main() {
    t := tango.Classic()
    t.Use(events.Events())
    t.Get("/", new(EventAction))
    t.Run()
}

License

This project is under BSD License. See the LICENSE file for the full license text.