This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

1package notella 2 3import ( 4 "encoding/json" 5 "fmt" 6 7 ll "github.com/gwennlbh/label-logger-go" 8 "github.com/nats-io/nats.go/jetstream" 9) 10 11const StreamName = "notella:stream" 12const SubjectName = "notella:notification" 13const ConsumerName = "NotellaConsumer" 14 15func NatsReceiver(m jetstream.Msg) error { 16 var message Message 17 err := json.Unmarshal(m.Data(), &message) 18 if err != nil { 19 return fmt.Errorf("while unmarshaling received message: %w", err) 20 } 21 22 if message.Event != EventShowScheduledJobs { 23 ll.Log("Received", "cyan", "%-10s | %-10s on %s", message.Id, message.Event, message.ChurrosObjectId) 24 } 25 26 if message.Event == EventClearScheduledJobs { 27 UnscheduleAllForObject(message.ChurrosObjectId) 28 return nil 29 } 30 31 message.Schedule() 32 33 return nil 34}