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"
|
2018-02-22 18:13:56 +00:00
|
|
|
// TypeSystemLicenseChange for when global admin user updates license
|
2017-05-01 12:13:05 +01:00
|
|
|
TypeSystemLicenseChange Type = "LICENSE_CHANGE"
|
2018-02-22 18:13:56 +00:00
|
|
|
// TypeAddSpace for when space created
|
|
|
|
TypeAddSpace Type = "SPACE_ADD"
|
|
|
|
// TypeRemoveSpace for when space removed
|
|
|
|
TypeRemoveSpace Type = "SPACE_REMOVE"
|
2017-05-01 12:13:05 +01:00
|
|
|
)
|