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