nidus-sync/platform/event.go

33 lines
708 B
Go
Raw Permalink Normal View History

package platform
import (
"time"
2026-03-13 18:31:43 +00:00
"github.com/Gleipnir-Technology/nidus-sync/config"
"github.com/Gleipnir-Technology/nidus-sync/platform/event"
)
type Envelope = event.Envelope
type Event = event.Event
const EventTypeHeartbeat = event.EventTypeHeartbeat
func EventShutdown() {
event.Shutdown()
}
func SetEventChannel(chan_events chan<- Envelope) {
event.SetEventChannel(chan_events)
}
2026-03-13 18:31:43 +00:00
func SudoEvent(org_id int32, resource, type_, uri_path string) {
event_type := event.EventTypeFromString(type_)
go event.Send(event.Envelope{
Event: Event{
2026-03-13 18:31:43 +00:00
Resource: resource,
Time: time.Now(),
2026-03-13 18:31:43 +00:00
Type: event_type,
URI: config.MakeURLNidus(uri_path),
},
OrganizationID: org_id,
})
}