-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
27 lines (22 loc) · 823 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main
import (
"context"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
"github.com/pkg/errors"
"github.com/meomap/citium/config"
"github.com/meomap/citium/scheduler"
)
func handler(conf *config.Configuration, conn dynamodbiface.DynamoDBAPI, client scheduler.Requester) func(ctx context.Context) error {
return func(ctx context.Context) error {
return errors.Wrap(scheduler.TriggerAPI(ctx, conf, conn, client), "scheduler.TriggerAPI")
}
}
func main() {
conf := config.Must(config.NewConfiguration())
dbconn := dynamodb.New(session.Must(session.NewSession(nil)))
client := scheduler.Must(scheduler.NewClient(conf))
lambda.Start(handler(conf, dbconn, client))
}