Lambda starter abstract the configurations of triggers in aws.
- SQS
- SNS
- S3
- Kinesis
- Api Gateway
- CloudWatch
To use is very simple you just need to implement the interface Handle and in your cmd call runner.Run passing your implementation of Handle.
func main() {
e := newExample()
err := lambdaRunner.Run(e)
if err != nil {
panic(err)
}
}
type example struct {
}
func newExample() handler.Handler {
return &example{}
}
func (h *example) Handle(ctx context.Context, messages []string) error {
log.Println("running lambda")
for _, message := range messages {
log.Println(message)
}
return nil
}