1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00
wakapi/config/eventbus.go

33 lines
711 B
Go
Raw Permalink Normal View History

2021-04-30 17:20:08 +03:00
package config
import "github.com/leandro-lugaresi/hub"
type ApplicationEvent struct {
Type string
Payload interface{}
}
const (
TopicUser = "user.*"
TopicHeartbeat = "heartbeat.*"
TopicProjectLabel = "project_label.*"
EventUserUpdate = "user.update"
EventHeartbeatCreate = "heartbeat.create"
EventProjectLabelCreate = "project_label.create"
EventProjectLabelDelete = "project_label.delete"
EventWakatimeFailure = "wakatime.failure"
FieldPayload = "payload"
FieldUser = "user"
FieldUserId = "user.id"
2021-04-30 17:20:08 +03:00
)
var eventHub *hub.Hub
func init() {
eventHub = hub.New()
}
func EventBus() *hub.Hub {
return eventHub
}