This involved moving a lot of stuff to the platform layer since I don't want event interfaces leaking out. Also this includes a fix to the user authentication which I had previously broken by making a platform-layer user object independent of the database layer.
27 lines
532 B
Go
27 lines
532 B
Go
package platform
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/platform/event"
|
|
)
|
|
|
|
type Envelope = event.Envelope
|
|
type Event = event.Event
|
|
|
|
const EventTypeHeartbeat = event.EventTypeHeartbeat
|
|
|
|
func SetEventChannel(chan_events chan<- Envelope) {
|
|
event.SetEventChannel(chan_events)
|
|
}
|
|
func SudoEvent(org_id int32, content string) {
|
|
go event.Send(event.Envelope{
|
|
Event: Event{
|
|
Resource: "sudo",
|
|
Time: time.Now(),
|
|
Type: event.EventTypeSudo,
|
|
URI: content,
|
|
},
|
|
OrganizationID: org_id,
|
|
})
|
|
}
|