Events middleware for tango
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lunny Xiao 2906df98f8
use go mod and moved to gitea.com
1 month ago
.drone.yml use go mod and moved to gitea.com 1 month ago
LICENSE license 4 years ago
README.md use go mod and moved to gitea.com 1 month ago
circle.yml update CI config 2 years ago
events.go migrate to gitea.com/lunny/tango 8 months ago
events_test.go migrate to gitea.com/lunny/tango 8 months ago
go.mod use go mod and moved to gitea.com 1 month ago
go.sum use go mod and moved to gitea.com 1 month 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.