fix(event-subscriber-example): remove event.go

the file was removed from zoraxy_plugin, but since `build_all.sh` works
by copying the module to the plugins this change wasn't propagated. This
fix removed the leftover file and updates `build_all.sh` to delete the
existing `zoraxy_plugin` module of the plugins before copying over the
updated code.
This commit is contained in:
Anthony Rubick
2025-09-07 17:10:02 -05:00
parent 73e4994ddc
commit 2f98ecd0c6
3 changed files with 8 additions and 123 deletions

View File

@@ -17,7 +17,7 @@ const (
)
var (
EventLog = make([]plugin.Event, 0) // A slice to store events
EventLog = make([]events.Event, 0) // A slice to store events
EventLogMutex = &sync.Mutex{} // Mutex to protect access to the event log
)
@@ -58,7 +58,7 @@ func main() {
})
http.HandleFunc(EVENT_PATH, func(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodPost {
var event plugin.Event
var event events.Event
// read the request body
if r.Body == nil || r.ContentLength == 0 {
@@ -74,7 +74,7 @@ func main() {
}
// parse the event from the request body
if err := plugin.ParseEvent(buffer.Bytes(), &event); err != nil {
if err := events.ParseEvent(buffer.Bytes(), &event); err != nil {
http.Error(w, fmt.Sprintf("Failed to parse event: %v", err), http.StatusBadRequest)
return
}