Skip to content

Commit

Permalink
update vendor deps; add webhookd-inflate-config tool
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Sep 8, 2020
1 parent 7db02c6 commit 20cdae7
Show file tree
Hide file tree
Showing 453 changed files with 59,392 additions and 98,448 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ bump-version:
perl -i -p -e 's/github.com\/whosonfirst\/go-webhookd\/$(PREVIOUS)/github.com\/whosonfirst\/go-webhookd\/$(NEW)/g' README.md
find . -name '*.go' | xargs perl -i -p -e 's/github.com\/whosonfirst\/go-webhookd\/$(PREVIOUS)/github.com\/whosonfirst\/go-webhookd\/$(NEW)/g'

tools:
cli:
go build -mod vendor -o bin/webhookd cmd/webhookd/main.go
go build -mod vendor -o bin/webhookd-generate-hook cmd/webhookd-generate-hook/main.go
go build -mod vendor -o bin/webhookd-flatten-config cmd/webhookd-flatten-config/main.go
go build -mod vendor -o bin/webhookd-inflate-config cmd/webhookd-inflate-config/main.go
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ In between (receivers and dispatchers) are an optional chain of transformations
You will need to have both `Go` (specifically version [1.12](https://golang.org/dl) or higher) and the `make` programs installed on your computer. Assuming you do just type:

```
make tools
$ > make cli
go build -mod vendor -o bin/webhookd cmd/webhookd/main.go
go build -mod vendor -o bin/webhookd-generate-hook cmd/webhookd-generate-hook/main.go
go build -mod vendor -o bin/webhookd-flatten-config cmd/webhookd-flatten-config/main.go
go build -mod vendor -o bin/webhookd-inflate-config cmd/webhookd-inflate-config/main.go
```

All of this package's dependencies are bundled with the code in the `vendor` directory.
Expand Down
51 changes: 51 additions & 0 deletions cmd/webhookd-inflate-config/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package main

import (
_ "context"
"flag"
"net/url"
"log"
"encoding/json"
"fmt"
"github.com/tidwall/pretty"
"github.com/whosonfirst/go-webhookd/v3/config"
)

func main (){

flag.Parse()

for _, uri := range flag.Args() {

u, err := url.Parse(uri)

if err != nil {
log.Fatal(err)
}

q := u.Query()

val := q.Get("val")

if val == "" {
log.Fatal("Missing ?val parameter")
}

var cfg *config.WebhookConfig

err = json.Unmarshal([]byte(val), &cfg)

if err != nil {
log.Fatal(err)
}

body, err := json.Marshal(cfg)

if err != nil {
log.Fatal(err)
}

body = pretty.Pretty(body)
fmt.Println(string(body))
}
}
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ go 1.12

require (
github.com/aaronland/go-chicken v0.2.1
github.com/aaronland/go-http-server v0.0.3
github.com/aaronland/go-http-server v0.0.5
github.com/aaronland/go-roster v0.0.2
github.com/sfomuseum/go-flags v0.3.1
gocloud.dev v0.19.0
github.com/sfomuseum/go-flags v0.4.1
github.com/tidwall/pretty v1.0.2
gocloud.dev v0.20.0
)
288 changes: 288 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/github.com/aaronland/go-http-server/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/aaronland/go-http-server/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

147 changes: 143 additions & 4 deletions vendor/github.com/aaronland/go-http-server/http.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions vendor/github.com/aaronland/go-http-server/lambda.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 6 additions & 41 deletions vendor/github.com/aaronland/go-http-server/tls.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 20cdae7

Please sign in to comment.