1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00
documize/core/event/new.go

31 lines
762 B
Go
Raw Normal View History

2017-05-01 12:13:05 +01:00
package event
// eventBus contains pub/sub
var eventBus Bus
func init() {
eventBus = New()
}
// Handler returns the global instance of the event bus
func Handler() Bus {
return eventBus
}
// Type defines the format of event descriptors
type Type string
// Valid event types for publication and subscription
const (
// TypeAddAccount for when account for user is created
TypeAddAccount Type = "ACCOUNT_ADD"
// TypeAddUser for when user is created
TypeAddUser Type = "USER_ADD"
// TypeRemoveUser for when user is deleted
TypeRemoveUser Type = "USER_DELETE"
// TypeAddDocument for when document created
TypeAddDocument Type = "DOCUMENT_ADD"
// TypeSystemLicenseChange for when adin updates license
TypeSystemLicenseChange Type = "LICENSE_CHANGE"
)