chore: add mercury

This commit is contained in:
xuu
2024-01-22 16:00:58 -07:00
parent eb63312542
commit d4e021386b
47 changed files with 6456 additions and 152 deletions

27
mercury/mqtt/notify.go Normal file
View File

@@ -0,0 +1,27 @@
package mqtt
import (
"context"
"go.sour.is/pkg/lg"
"go.sour.is/pkg/mercury"
)
type mqttNotify struct{}
func (mqttNotify) SendNotify(ctx context.Context, n mercury.Notify) {
_, span := lg.Span(ctx)
defer span.End()
// var m mqtt.Message
// m, err = mqtt.NewMessage(n.URL, n)
// if err != nil {
// return
// }
// log.Debug(n)
// err = mqtt.Publish(m)
// return
}
func Register() {
mercury.Registry.Register("mqtt-notify", func(s *mercury.Space) any { return &mqttNotify{} })
}