Compare commits

4 Commits

Author SHA1 Message Date
Adrian Zuercher
fee2381a45 Merge branch 'main' of https://gitea.tecamino.com/paadi/pubSub 2025-08-22 14:35:04 +02:00
Adrian Zuercher
a92a4d9fde . 2025-08-22 14:35:01 +02:00
3a243546e9 pubSub.go aktualisiert 2025-08-22 14:32:20 +02:00
d6d5466597 models/data.go aktualisiert 2025-08-22 14:31:53 +02:00
2 changed files with 9 additions and 2 deletions

View File

@@ -1,7 +1,14 @@
package models
import "encoding/json"
type Data struct {
Action string `json:"action"`
Action string `json:"action,omitempty"`
Topic string `json:"topic"`
Data any `json:"data"`
}
func (*Data) ReadData(data []byte) (request Data, err error) {
err = json.Unmarshal(data, &request)
return
}

View File

@@ -53,7 +53,7 @@ func (ps *Pubsub) worker() {
func(c func(any), d any) {
defer func() { recover() }()
c(d)
}(cb, job.Data)
}(cb, job)
}
}
}