package api import ( "git.aiterp.net/lucifer/server3/app/config" "git.aiterp.net/lucifer/server3/models" "github.com/gin-gonic/gin" ) func Events(r gin.IRoutes) { r.POST("", handler(func(c *gin.Context) (interface{}, error) { var event models.Event err := parseBody(c, &event) if err != nil { return nil, err } config.EventChannel<-event return event, nil })) }