Events middleware for tango
Go to file
Lunny Xiao dd347b1432
All checks were successful
checks / check and test (push) Successful in 32s
Use actions instead of drone
2023-04-20 15:26:39 +08:00
.gitea/workflows Use actions instead of drone 2023-04-20 15:26:39 +08:00
LICENSE license 2015-04-28 15:46:54 +08:00
README.md use go mod and moved to gitea.com 2019-10-31 22:25:31 +08:00
events.go migrate to gitea.com/lunny/tango 2019-03-26 15:51:28 +08:00
events_test.go migrate to gitea.com/lunny/tango 2019-03-26 15:51:28 +08:00
go.mod use go mod and moved to gitea.com 2019-10-31 22:25:31 +08:00
go.sum use go mod and moved to gitea.com 2019-10-31 22:25:31 +08:00

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.