Sparta v1.14.0 Release Notes

Release Date: 2020-02-24 // almost 2 years ago
    • 💥 :warning: BREAKING
    • :checkered_flag: CHANGES

        func echoEventBridgeEvent(ctx context.Context, msg json.RawMessage) (interface{}, error) {
          logger, _ := ctx.Value(sparta.ContextKeyLogger).(*logrus.Logger)
          var eventData map[string]interface{}
          err := json.Unmarshal(msg, &eventData)
          logger.WithFields(logrus.Fields{
            "error":   err,
            "message": eventData,
          }).Info("EventBridge event")
          return nil, err
        }
      
        func main() {
          //...
          eventBridgeReactorFunc := spartaArchetype.EventBridgeReactorFunc(echoEventBridgeEvent)
          lambdaFn, _ := spartaArchetype.NewEventBridgeScheduledReactor(eventBridgeReactorFunc,
                          "rate(1 minute)",
                          nil)
          // Register lambdaFn
        }
      
    • 🛠 :bug: FIXED