events/README.md
Lunny Xiao 2906df98f8
All checks were successful
continuous-integration/drone/push Build is passing
use go mod and moved to gitea.com
2019-10-31 22:25:31 +08:00

850 B

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.