netlify-cli 9.14.0 → 9.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "9.14.0",
3
+ "version": "9.15.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "9.14.0",
9
+ "version": "9.15.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "9.14.0",
4
+ "version": "9.15.0",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
@@ -30,6 +30,7 @@
30
30
  "Cole Bosmann",
31
31
  "Dan Croak (https://twitter.com/croaky)",
32
32
  "Dan Loewenherz <dan@lionheartsw.com> (https://twitter.com/dwlz)",
33
+ "Daniel Woelfel <dwwoelfel@gmail.com> (https://twitter.com/danielwoelfel)",
33
34
  "Dave Ackerman <dmackerman@gmail.com>",
34
35
  "David Calavera <david@netlify.com> (https://twitter.com/calavera)",
35
36
  "David Lemler <dlemler@pm.me> (https://twitter.com/davidlemlerm)",
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ name: 'scheduled-function',
3
+ priority: 1,
4
+ description: 'Basic implementation of a scheduled function in Go.',
5
+ }
@@ -0,0 +1,5 @@
1
+ module github.com/your-github-handle/{{name}}
2
+
3
+ go 1.17
4
+
5
+ require github.com/aws/aws-lambda-go v1.28.0
@@ -0,0 +1,21 @@
1
+ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
2
+ github.com/aws/aws-lambda-go v1.28.0 h1:fZiik1PZqW2IyAN4rj+Y0UBaO1IDFlsNo9Zz/XnArK4=
3
+ github.com/aws/aws-lambda-go v1.28.0/go.mod h1:jJmlefzPfGnckuHdXX7/80O3BvUUi12XOkbv4w9SGLU=
4
+ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
5
+ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
6
+ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7
+ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
8
+ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
10
+ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
11
+ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
12
+ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
13
+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
14
+ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
15
+ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
16
+ github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
17
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
18
+ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
19
+ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
20
+ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
21
+ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@@ -0,0 +1,11 @@
1
+ [build]
2
+ functions = "functions"
3
+
4
+ [build.environment]
5
+ GO_VERSION = "1.17"
6
+
7
+ [functions]
8
+ directory = "src/"
9
+
10
+ [functions.hourly-schedule]
11
+ schedule = "@hourly"
@@ -0,0 +1,36 @@
1
+ package main
2
+
3
+ import (
4
+ "context"
5
+ "encoding/json"
6
+ "log"
7
+ "net/http"
8
+ "time"
9
+
10
+ "github.com/aws/aws-lambda-go/events"
11
+ "github.com/aws/aws-lambda-go/lambda"
12
+ )
13
+
14
+ type requestBody struct {
15
+ NextRun time.Time `json:"next_run"`
16
+ }
17
+
18
+ // The schedule for this function is defined inside the netlify.toml file. To learn about scheduled functions
19
+ // and supported cron extensions, visit https://ntl.fyi/sched-func.
20
+ func handler(ctx context.Context, request events.APIGatewayProxyRequest) (*events.APIGatewayProxyResponse, error) {
21
+ requestBody := requestBody{}
22
+
23
+ if err := json.Unmarshal([]byte(request.Body), &requestBody); err != nil {
24
+ log.Fatalf("cannot parse request body: %s", err.Error())
25
+ }
26
+
27
+ log.Printf("Next run at %s\n", requestBody.NextRun.Local())
28
+
29
+ return &events.APIGatewayProxyResponse{
30
+ StatusCode: http.StatusNoContent,
31
+ }, nil
32
+ }
33
+
34
+ func main() {
35
+ lambda.Start(handler)
36
+ }