├── .DEREK.yml ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── build.yaml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── cmd └── tester │ ├── .gitignore │ ├── README.md │ ├── kubectl.go │ └── main.go ├── go.mod ├── go.sum └── types ├── controller.go ├── controller_config.go ├── credentials.go ├── function_list_builder.go ├── function_list_builder_test.go ├── invoker.go ├── make_client.go ├── response_printer.go ├── response_subscriber.go └── topic_map.go /.DEREK.yml: -------------------------------------------------------------------------------- 1 | redirect: https://raw.githubusercontent.com/openfaas/faas/master/.DEREK.yml 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## My actions before raising this issue 4 | - [ ] Followed the [troubleshooting guide](https://docs.openfaas.com/deployment/troubleshooting/) 5 | - [ ] Read/searched [the docs](https://docs.openfaas.com/) 6 | - [ ] Searched [past issues](/issues) 7 | 8 | 9 | 10 | 11 | ## Expected Behaviour 12 | 13 | 14 | 15 | 16 | ## Current Behaviour 17 | 18 | 19 | 20 | 21 | ## Possible Solution 22 | 23 | 24 | 25 | 26 | ## Steps to Reproduce (for bugs) 27 | 28 | 29 | 1. 30 | 2. 31 | 3. 32 | 4. 33 | 34 | ## Context 35 | 36 | 37 | 38 | 39 | ## Your Environment 40 | 41 | * FaaS-CLI version ( Full output from: `faas-cli version` ): 42 | 43 | * Docker version `docker version` (e.g. Docker 17.0.05 ): 44 | 45 | * Are you using Docker Swarm or Kubernetes (FaaS-netes)? 46 | 47 | * Operating System and version (e.g. Linux, Windows, MacOS): 48 | 49 | * Code example or link to GitHub repo or gist to reproduce problem: 50 | 51 | * Other diagnostic information / logs from [troubleshooting guide](https://docs.openfaas.com/deployment/troubleshooting) 52 | 53 | ## Next steps 54 | 55 | You may [join Slack](https://docs.openfaas.com/community) for community support. 56 | 57 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | ## Motivation and Context 7 | 8 | 9 | - [ ] I have raised an issue to propose this change ([required](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md)) 10 | - [ ] My issue has received approval from the maintainers or lead with the `design/approved` label 11 | 12 | 13 | ## How Has This Been Tested? 14 | 15 | 16 | 17 | 18 | 19 | ## Types of changes 20 | 21 | - [ ] Bug fix (non-breaking change which fixes an issue) 22 | - [ ] New feature (non-breaking change which adds functionality) 23 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 24 | 25 | 26 | ## Checklist: 27 | 28 | 29 | - [ ] My code follows the code style of this project. 30 | - [ ] My change requires a change to the documentation. 31 | - [ ] I have updated the documentation accordingly. 32 | - [ ] I've read the [CONTRIBUTION](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md) guide 33 | - [ ] I have signed-off my commits with `git commit -s` 34 | - [ ] I have added tests to cover my changes. 35 | - [ ] All new and existing tests passed. 36 | -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | pull_request: 8 | branches: 9 | - '*' 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@master 17 | with: 18 | fetch-depth: 1 19 | - name: Install Go 20 | uses: actions/setup-go@master 21 | with: 22 | go-version: "1.23.x" 23 | - name: golangci-lint 24 | uses: golangci/golangci-lint-action@v6 25 | with: 26 | args: --issues-exit-code=0 27 | - name: Test 28 | run: make test 29 | - name: Build 30 | run: make tester 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .ash_history 2 | connector 3 | kafka-connector 4 | cmd/tester/tester 5 | .vscode -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2020 Alex Ellis 4 | Copyright (c) 2017-2020 OpenFaaS Project 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | go test ./types/ 3 | 4 | tester: 5 | go build ./cmd/tester 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## connector-sdk 2 | 3 | The connector-sdk is a library written in Go that you can use to create event-connectors for OpenFaaS functions. 4 | 5 | How it works: 6 | 7 | * Create a new CLI application with Go 8 | * Add the code to subscribe to events or messages from your source - i.e. a database, webhooks, message queue 9 | * Add the `github.com/openfaas/connector-sdk/types` package to your code 10 | * Setup a `types.ControllerConfig` with the gateway location 11 | * Run `types.NewController` 12 | * Whenever you receive a message from your source, run `controller.Invoke(topic, data)` 13 | 14 | Then whichever functions in your cluster have matching annotation of "topic: topic" will be invoked. 15 | 16 | ### Conceptual design: 17 | 18 | ![Conceptual design](https://pbs.twimg.com/media/DrlGTNtWkAEGbnQ.jpg) 19 | 20 | > Each function expresses which topics it can be triggered by, the broker then invokes them using the SDK. 21 | 22 | See also: [Triggers in OpenFaaS](https://docs.openfaas.com/reference/triggers/) 23 | 24 | ## Creating your own connector 25 | 26 | See the examples in the [OpenFaaS Docs](https://docs.openfaas.com/reference/triggers/) for inspiration. 27 | 28 | You can copy one of them and adapt it, or see the "tester" example in this repo. 29 | 30 | The tester example doesn't have an event subscription, but a for loop and sleep combination which simulates receiving an event. You would replace the timer with the callback function from your source such as a HTTP webhook endpoint, a pub-sub SDK or likewise. 31 | 32 | Within the event subscriber code, you should call "Invoke()", passing in the topic and message. The functions advertise their "topic". 33 | 34 | ```go 35 | 36 | additionalHeaders := http.Header{} 37 | additionalHeaders.Add("X-Served-By", "cmd/tester") 38 | 39 | // Simulate events emitting from queue/pub-sub 40 | for { 41 | log.Printf("Invoking on topic payment - %s\n", gateway) 42 | time.Sleep(2 * time.Second) 43 | data := []byte("test " + time.Now().String()) 44 | controller.Invoke("payment", &data, additionalHeaders) 45 | } 46 | ``` 47 | 48 | The results can then be printed using a result receiver. 49 | 50 | ```go 51 | // ResponseReceiver enables connector to receive results from the 52 | // function invocation 53 | type ResponseReceiver struct { 54 | } 55 | 56 | // Response is triggered by the controller when a message is 57 | // received from the function invocation 58 | func (ResponseReceiver) Response(res types.InvokerResponse) { 59 | if res.Error != nil { 60 | log.Printf("tester got error: %s", res.Error.Error()) 61 | } else { 62 | log.Printf("tester got result: [%d] %s => %s (%d) bytes", res.Status, res.Topic, res.Function, len(*res.Body)) 63 | } 64 | } 65 | ``` 66 | 67 | There are no retry mechanisms at present, but you could use the receiver to requeue failed invocations, or to send on to a dead-letter queue (DLQ). 68 | 69 | If you expect many requests in a short period of time, you may want to defer the executions using OpenFaaS' built-in asynchronous queue. 70 | 71 | Set the following in `ControllerConfig`: 72 | 73 | ```go 74 | config := &types.ControllerConfig{ 75 | ... 76 | AsyncFunctionInvocation: true, 77 | } 78 | ``` 79 | 80 | If you need to use the `Content-Type` header to validate or to check when it invoke the function you can set the `Content-Type` 81 | in `ControllerConfig`: 82 | 83 | ```go 84 | config := &types.ControllerConfig{ 85 | ... 86 | ContentType: "application/json", 87 | } 88 | ``` 89 | 90 | View the code: [cmd/tester/main.go](cmd/tester/main.go) 91 | 92 | ## License 93 | 94 | MIT 95 | -------------------------------------------------------------------------------- /cmd/tester/.gitignore: -------------------------------------------------------------------------------- 1 | tester 2 | -------------------------------------------------------------------------------- /cmd/tester/README.md: -------------------------------------------------------------------------------- 1 | ## tester example 2 | 3 | Test and emit to the "payment.received" topic 4 | 5 | ```sh 6 | go build 7 | export PASSWORD="Your gateway password" 8 | ./tester \ 9 | -username=admin \ 10 | -password=$PASSWORD 11 | ``` 12 | 13 | Deploy an example function to be triggered by the topic: 14 | 15 | ```bash 16 | faas-cli store deploy printer --annotation topic=payment.received 17 | ``` 18 | 19 | Emit a custom topic: 20 | 21 | ```sh 22 | go build 23 | export PASSWORD="Your gateway password" 24 | 25 | ./tester \ 26 | -username=admin \ 27 | -password=$PASSWORD \ 28 | -topic "custom/topic/1" 29 | ``` 30 | 31 | Deploy an example function to be triggered by the topic: 32 | 33 | ```bash 34 | faas-cli store deploy printer --annotation topic=custom/topic/1 35 | ``` 36 | -------------------------------------------------------------------------------- /cmd/tester/kubectl.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | b64 "encoding/base64" 5 | "strings" 6 | 7 | execute "github.com/alexellis/go-execute/pkg/v1" 8 | ) 9 | 10 | func lookupPasswordViaKubectl() string { 11 | 12 | cmd := execute.ExecTask{ 13 | Command: "kubectl", 14 | Args: []string{"get", "secret", "-n", "openfaas", "basic-auth", "-o", "jsonpath='{.data.basic-auth-password}'"}, 15 | StreamStdio: false, 16 | PrintCommand: false, 17 | } 18 | 19 | res, err := cmd.Execute() 20 | if err != nil { 21 | panic(err) 22 | } 23 | 24 | if res.ExitCode != 0 { 25 | panic("Non-zero exit code: " + res.Stderr) 26 | } 27 | resOut := strings.Trim(res.Stdout, "\\'") 28 | 29 | decoded, err := b64.StdEncoding.DecodeString(resOut) 30 | if err != nil { 31 | panic(err) 32 | } 33 | 34 | password := strings.TrimSpace(string(decoded)) 35 | 36 | return password 37 | } 38 | -------------------------------------------------------------------------------- /cmd/tester/main.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package main 5 | 6 | import ( 7 | "encoding/json" 8 | "flag" 9 | "fmt" 10 | "log" 11 | "net/http" 12 | "time" 13 | 14 | "github.com/openfaas/connector-sdk/types" 15 | sdk "github.com/openfaas/go-sdk" 16 | ) 17 | 18 | func main() { 19 | 20 | var ( 21 | username, 22 | password, 23 | gateway, 24 | topic string 25 | interval time.Duration 26 | ) 27 | 28 | flag.StringVar(&username, "username", "admin", "username") 29 | flag.StringVar(&password, "password", "", "password") 30 | flag.StringVar(&gateway, "gateway", "http://127.0.0.1:8080", "gateway") 31 | flag.DurationVar(&interval, "interval", time.Second*10, "Interval between emitting a sample message") 32 | flag.StringVar(&topic, "topic", "payment.received", "Sample topic name to emit from timer") 33 | 34 | flag.Parse() 35 | 36 | if len(password) == 0 { 37 | password = lookupPasswordViaKubectl() 38 | } 39 | 40 | // Set Print* variables to false for production use 41 | 42 | config := &types.ControllerConfig{ 43 | RebuildInterval: time.Second * 30, 44 | GatewayURL: gateway, 45 | PrintResponse: true, 46 | PrintRequestBody: true, 47 | PrintResponseBody: true, 48 | AsyncFunctionInvocation: false, 49 | ContentType: "text/plain", 50 | UserAgent: "openfaas-ce/timer-connector", 51 | UpstreamTimeout: time.Second * 120, 52 | } 53 | 54 | fmt.Printf("Tester connector. Topic: %s, Interval: %s\n", topic, interval) 55 | 56 | auth := &sdk.BasicAuth{ 57 | Username: username, 58 | Password: password, 59 | } 60 | 61 | controller := types.NewController(auth, config) 62 | 63 | receiver := ResponseReceiver{} 64 | controller.Subscribe(&receiver) 65 | 66 | controller.BeginMapBuilder() 67 | 68 | additionalHeaders := http.Header{} 69 | additionalHeaders.Add("X-Connector", "cmd/timer") 70 | 71 | // Simulate events emitting from queue/pub-sub 72 | // by sleeping for 10 seconds between emitting the same message 73 | messageID := 0 74 | 75 | t := time.NewTicker(interval) 76 | for { 77 | <-t.C 78 | 79 | log.Printf("[tester] Emitting event on topic payment.received - %s\n", gateway) 80 | 81 | h := additionalHeaders.Clone() 82 | // Add a de-dupe header to the message 83 | h.Add("X-Message-Id", fmt.Sprintf("%d", messageID)) 84 | 85 | payload, _ := json.Marshal(samplePayload{ 86 | CreatedAt: time.Now(), 87 | MessageID: messageID, 88 | }) 89 | 90 | controller.Invoke(topic, &payload, h) 91 | 92 | messageID++ 93 | 94 | t.Reset(interval) 95 | } 96 | } 97 | 98 | type samplePayload struct { 99 | CreatedAt time.Time `json:"createdAt"` 100 | MessageID int `json:"messageId"` 101 | } 102 | 103 | // ResponseReceiver enables connector to receive results from the 104 | // function invocation 105 | type ResponseReceiver struct { 106 | } 107 | 108 | // Response is triggered by the controller when a message is 109 | // received from the function invocation 110 | func (ResponseReceiver) Response(res types.InvokerResponse) { 111 | if res.Error != nil { 112 | log.Printf("[tester] error: %s", res.Error.Error()) 113 | } else { 114 | log.Printf("[tester] result: [%d] %s => %s (%d) bytes (%fs)", res.Status, res.Topic, res.Function, len(*res.Body), res.Duration.Seconds()) 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/openfaas/connector-sdk 2 | 3 | go 1.23 4 | 5 | require ( 6 | github.com/alexellis/go-execute v0.6.0 7 | github.com/openfaas/faas-provider v0.25.4 8 | ) 9 | 10 | require ( 11 | github.com/beorn7/perks v1.0.1 // indirect 12 | github.com/cespare/xxhash/v2 v2.2.0 // indirect 13 | github.com/golang/protobuf v1.5.3 // indirect 14 | github.com/gorilla/mux v1.8.0 // indirect 15 | github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect 16 | github.com/openfaas/go-sdk v0.2.14 // indirect 17 | github.com/prometheus/client_golang v1.16.0 // indirect 18 | github.com/prometheus/client_model v0.3.0 // indirect 19 | github.com/prometheus/common v0.42.0 // indirect 20 | github.com/prometheus/procfs v0.10.1 // indirect 21 | golang.org/x/sys v0.8.0 // indirect 22 | google.golang.org/protobuf v1.33.0 // indirect 23 | ) 24 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 6 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 7 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 8 | cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= 9 | cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= 10 | cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= 11 | cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= 12 | cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= 13 | cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= 14 | cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= 15 | cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= 16 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 17 | cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= 18 | cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= 19 | cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= 20 | cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= 21 | cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= 22 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 23 | cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= 24 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 25 | cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= 26 | cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= 27 | cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= 28 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 29 | cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= 30 | cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= 31 | cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= 32 | cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= 33 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 34 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 35 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 36 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 37 | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 38 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 39 | github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 40 | github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= 41 | github.com/alexellis/go-execute v0.5.0 h1:L8kgNlFzNbJov7jrInlaig7i6ZUSz/tYYmqvb8dyD0s= 42 | github.com/alexellis/go-execute v0.5.0/go.mod h1:AgHTcsCF9wrP0mMVTO8N+lFw1Biy71NybBOk8M+qgy8= 43 | github.com/alexellis/go-execute v0.6.0 h1:FVGoudJnWSObwf9qmehbvVuvhK6g1UpKOCBjS+OUXEA= 44 | github.com/alexellis/go-execute v0.6.0/go.mod h1:nlg2F6XdYydUm1xXQMMiuibQCV1mveybBkNWfdNznjk= 45 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 46 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 47 | github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 48 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 49 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 50 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 51 | github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 52 | github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= 53 | github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 54 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 55 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 56 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 57 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 58 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 59 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 60 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 61 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 62 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 63 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 64 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 65 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 66 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 67 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 68 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 69 | github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 70 | github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= 71 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 72 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 73 | github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= 74 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 75 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 76 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 77 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 78 | github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 79 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 80 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 81 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 82 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 83 | github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 84 | github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 85 | github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 86 | github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 87 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 88 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 89 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 90 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 91 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 92 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 93 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 94 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 95 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 96 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 97 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 98 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 99 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 100 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 101 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 102 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 103 | github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= 104 | github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 105 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 106 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 107 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 108 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 109 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 110 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 111 | github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 112 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 113 | github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 114 | github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 115 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 116 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 117 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 118 | github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 119 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 120 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 121 | github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 122 | github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 123 | github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 124 | github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 125 | github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 126 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 127 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 128 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 129 | github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= 130 | github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= 131 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 132 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 133 | github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 134 | github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= 135 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 136 | github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 137 | github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 138 | github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 139 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 140 | github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 141 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 142 | github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 143 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 144 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 145 | github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 146 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 147 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 148 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 149 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 150 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 151 | github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= 152 | github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= 153 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 154 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 155 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 156 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 157 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 158 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 159 | github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 160 | github.com/openfaas/faas-provider v0.19.1 h1:xH8lTWabfDZwzIvC0u1AO48ghD3BNw6Vo231DLqTeI0= 161 | github.com/openfaas/faas-provider v0.19.1/go.mod h1:Farrp+9Med8LeK3aoYpqplMP8f5ebTILbCSLg2LPLZk= 162 | github.com/openfaas/faas-provider v0.25.4 h1:Cly/M8/Q+OOn8qFxxeaZGyC5B2x4f+RSU28hej+1WcM= 163 | github.com/openfaas/faas-provider v0.25.4/go.mod h1:t6RSPCvNfiqYEzf/CtdIj+0OItdyK6IzrOca1EOLNSg= 164 | github.com/openfaas/go-sdk v0.2.14 h1:N3bq0yparYZR6pR1AhZiPGvV8GAmQ1UfjmCOGaZMs68= 165 | github.com/openfaas/go-sdk v0.2.14/go.mod h1:DrKUCQ4F8L2cJOmWHNoX8zB8LQIZc/4hRgAtT4t0s4k= 166 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 167 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 168 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 169 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 170 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 171 | github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= 172 | github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= 173 | github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= 174 | github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= 175 | github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= 176 | github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= 177 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 178 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 179 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 180 | github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 181 | github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= 182 | github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= 183 | github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 184 | github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= 185 | github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= 186 | github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= 187 | github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= 188 | github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= 189 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 190 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 191 | github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= 192 | github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= 193 | github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= 194 | github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= 195 | github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= 196 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 197 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 198 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 199 | github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 200 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 201 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 202 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 203 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 204 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 205 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 206 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 207 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 208 | github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 209 | github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 210 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 211 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 212 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 213 | go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 214 | go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 215 | go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= 216 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 217 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 218 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 219 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 220 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 221 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 222 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 223 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 224 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 225 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 226 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 227 | golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 228 | golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 229 | golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 230 | golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 231 | golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= 232 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 233 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 234 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 235 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 236 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 237 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 238 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 239 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 240 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 241 | golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 242 | golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 243 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 244 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 245 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 246 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 247 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 248 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 249 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 250 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 251 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 252 | golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 253 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 254 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 255 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 256 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 257 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 258 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 259 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 260 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 261 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 262 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 263 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 264 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 265 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 266 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 267 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 268 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 269 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 270 | golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 271 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 272 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 273 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 274 | golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 275 | golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 276 | golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 277 | golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 278 | golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 279 | golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 280 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 281 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 282 | golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 283 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 284 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 285 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 286 | golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 287 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 288 | golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 289 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 290 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 291 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 292 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 293 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 294 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 295 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 296 | golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 297 | golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 298 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 299 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 300 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 301 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 302 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 303 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 304 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 305 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 306 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 307 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 308 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 309 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 310 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 311 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 312 | golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 313 | golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 314 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 315 | golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 316 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 317 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 318 | golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 319 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 320 | golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 321 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 322 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 323 | golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 324 | golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 325 | golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 326 | golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 327 | golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 328 | golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 329 | golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 330 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 331 | golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 332 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 333 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 334 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 335 | golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 336 | golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 337 | golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= 338 | golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 339 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 340 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 341 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 342 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 343 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 344 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 345 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 346 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 347 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 348 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 349 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 350 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 351 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 352 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 353 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 354 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 355 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 356 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 357 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 358 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 359 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 360 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 361 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 362 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 363 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 364 | golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 365 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 366 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 367 | golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 368 | golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 369 | golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 370 | golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 371 | golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 372 | golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 373 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 374 | golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 375 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 376 | golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 377 | golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 378 | golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 379 | golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 380 | golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 381 | golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= 382 | golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 383 | golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 384 | golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 385 | golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 386 | golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 387 | golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 388 | golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 389 | golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 390 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 391 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 392 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 393 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 394 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 395 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 396 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 397 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 398 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 399 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 400 | google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 401 | google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 402 | google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 403 | google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 404 | google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 405 | google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 406 | google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 407 | google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 408 | google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= 409 | google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 410 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 411 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 412 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 413 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 414 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 415 | google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 416 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 417 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 418 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 419 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 420 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 421 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 422 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 423 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 424 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 425 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 426 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 427 | google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 428 | google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 429 | google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 430 | google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= 431 | google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 432 | google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 433 | google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 434 | google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 435 | google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 436 | google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 437 | google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 438 | google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 439 | google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= 440 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 441 | google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= 442 | google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 443 | google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 444 | google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 445 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 446 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 447 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 448 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 449 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 450 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 451 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 452 | google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 453 | google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= 454 | google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= 455 | google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 456 | google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 457 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 458 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 459 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 460 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 461 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 462 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 463 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 464 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 465 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 466 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 467 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 468 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 469 | google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= 470 | google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 471 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 472 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 473 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 474 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 475 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 476 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 477 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 478 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 479 | gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 480 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 481 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 482 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 483 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 484 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 485 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 486 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 487 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 488 | honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 489 | honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 490 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 491 | rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= 492 | rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= 493 | -------------------------------------------------------------------------------- /types/controller.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "context" 8 | "fmt" 9 | "log" 10 | "net/http" 11 | "sync" 12 | "time" 13 | 14 | "github.com/openfaas/go-sdk" 15 | ) 16 | 17 | // Controller is used to invoke functions on a per-topic basis and to subscribe to responses returned by said functions. 18 | type Controller interface { 19 | Subscribe(subscriber ResponseSubscriber) 20 | Invoke(topic string, message *[]byte, headers http.Header) 21 | InvokeWithContext(ctx context.Context, topic string, message *[]byte, headers http.Header) 22 | BeginMapBuilder() 23 | Topics() []string 24 | } 25 | 26 | // controller is the default implementation of the Controller interface. 27 | type controller struct { 28 | // Config for the controller 29 | Config *ControllerConfig 30 | 31 | // Invoker to invoke functions via HTTP(s) 32 | Invoker *Invoker 33 | 34 | // Map of which functions subscribe to which topics 35 | TopicMap *TopicMap 36 | 37 | Auth sdk.ClientAuth 38 | 39 | // Subscribers which can receive messages from invocations. 40 | // See note on ResponseSubscriber interface about blocking/long-running 41 | // operations 42 | Subscribers []ResponseSubscriber 43 | 44 | // lock used for synchronizing subscribers 45 | lock *sync.RWMutex 46 | } 47 | 48 | // NewController create a new connector SDK controller 49 | func NewController(auth sdk.ClientAuth, config *ControllerConfig) Controller { 50 | 51 | gatewayFunctionPath := gatewayRoute(config) 52 | 53 | invoker := NewInvoker(gatewayFunctionPath, 54 | MakeClient(config.UpstreamTimeout), 55 | config.ContentType, 56 | config.PrintResponse, 57 | config.PrintRequestBody, 58 | config.UserAgent) 59 | 60 | subs := []ResponseSubscriber{} 61 | 62 | topicMap := NewTopicMap() 63 | 64 | c := controller{ 65 | Config: config, 66 | Invoker: invoker, 67 | TopicMap: &topicMap, 68 | Auth: auth, 69 | Subscribers: subs, 70 | lock: &sync.RWMutex{}, 71 | } 72 | 73 | if config.PrintResponse { 74 | c.Subscribe(&ResponsePrinter{config.PrintResponseBody}) 75 | } 76 | 77 | go func(ch *chan InvokerResponse, controller *controller) { 78 | for { 79 | res := <-*ch 80 | 81 | controller.lock.RLock() 82 | for _, sub := range controller.Subscribers { 83 | sub.Response(res) 84 | } 85 | controller.lock.RUnlock() 86 | } 87 | }(&invoker.Responses, &c) 88 | 89 | return &c 90 | } 91 | 92 | // Subscribe adds a ResponseSubscriber to the list of subscribers 93 | // which receive messages upon function invocation or error 94 | // Note: it is not possible to Unsubscribe at this point using 95 | // the API of the controller 96 | func (c *controller) Subscribe(subscriber ResponseSubscriber) { 97 | c.lock.Lock() 98 | defer c.lock.Unlock() 99 | c.Subscribers = append(c.Subscribers, subscriber) 100 | } 101 | 102 | // Invoke attempts to invoke any functions which match the 103 | // topic the incoming message was published on. 104 | func (c *controller) Invoke(topic string, message *[]byte, headers http.Header) { 105 | c.InvokeWithContext(context.Background(), topic, message, headers) 106 | } 107 | 108 | // InvokeWithContext attempts to invoke any functions which match the topic 109 | // the incoming message was published on while propagating context. 110 | func (c *controller) InvokeWithContext(ctx context.Context, topic string, message *[]byte, headers http.Header) { 111 | c.Invoker.InvokeWithContext(ctx, c.TopicMap, topic, message, headers) 112 | } 113 | 114 | // BeginMapBuilder begins to build a map of function->topic by 115 | // querying the API gateway. 116 | func (c *controller) BeginMapBuilder() { 117 | 118 | lookupBuilder := NewFunctionLookupBuilder(c.Config.GatewayURL, c.Config.TopicAnnotationDelimiter, MakeClient(c.Config.UpstreamTimeout), c.Auth) 119 | 120 | ticker := time.NewTicker(c.Config.RebuildInterval) 121 | go c.synchronizeLookups(ticker, lookupBuilder, c.TopicMap) 122 | } 123 | 124 | func (c *controller) synchronizeLookups(ticker *time.Ticker, 125 | lookupBuilder *FunctionLookupBuilder, 126 | topicMap *TopicMap) { 127 | 128 | fn := func() { 129 | lookups, err := lookupBuilder.Build() 130 | if err != nil { 131 | log.Fatalln(err) 132 | } 133 | 134 | if c.Config.PrintSync { 135 | log.Println("Syncing topic map") 136 | } 137 | 138 | topicMap.Sync(&lookups) 139 | } 140 | 141 | fn() 142 | for { 143 | <-ticker.C 144 | fn() 145 | } 146 | } 147 | 148 | // Topics gets the list of topics that functions have indicated should 149 | // be used as triggers. 150 | func (c *controller) Topics() []string { 151 | return c.TopicMap.Topics() 152 | } 153 | 154 | func gatewayRoute(config *ControllerConfig) string { 155 | if config.AsyncFunctionInvocation { 156 | return fmt.Sprintf("%s/%s", config.GatewayURL, "async-function") 157 | } 158 | return fmt.Sprintf("%s/%s", config.GatewayURL, "function") 159 | } 160 | -------------------------------------------------------------------------------- /types/controller_config.go: -------------------------------------------------------------------------------- 1 | // ControllerConfig configures a connector SDK controller 2 | package types 3 | 4 | import "time" 5 | 6 | type ControllerConfig struct { 7 | // UpstreamTimeout controls maximum timeout for a function invocation, which is done via the gateway 8 | UpstreamTimeout time.Duration 9 | 10 | // GatewayURL is the remote OpenFaaS gateway 11 | GatewayURL string 12 | 13 | // PrintResponse if true prints the function responses 14 | PrintResponse bool 15 | 16 | // PrintResponseBody prints the function's response body to stdout 17 | PrintResponseBody bool 18 | 19 | // PrintRequestBody prints the request's body to stdout. 20 | PrintRequestBody bool 21 | 22 | // RebuildInterval the interval at which the topic map is rebuilt 23 | RebuildInterval time.Duration 24 | 25 | // TopicAnnotationDelimiter defines the character upon which to split the Topic annotation value 26 | TopicAnnotationDelimiter string 27 | 28 | // AsyncFunctionInvocation if true points to the asynchronous function route 29 | AsyncFunctionInvocation bool 30 | 31 | // PrintSync indicates whether the sync should be logged. 32 | PrintSync bool 33 | 34 | // ContentType defines which content type will be set in the header to inkoke the function. i.e "application/json". 35 | // Optional, if not set the Content-Type header will not be set. 36 | ContentType string 37 | 38 | // BasicAuth whether basic auth is enabled or disabled 39 | BasicAuth bool 40 | 41 | // UserAgent defines the user agent to be used in the request to invoke the function, it should be of the format: 42 | // company/NAME-connector 43 | UserAgent string 44 | } 45 | -------------------------------------------------------------------------------- /types/credentials.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "os" 8 | 9 | "github.com/openfaas/faas-provider/auth" 10 | ) 11 | 12 | func GetCredentials() *auth.BasicAuthCredentials { 13 | var credentials *auth.BasicAuthCredentials 14 | 15 | if val, ok := os.LookupEnv("basic_auth"); ok && len(val) > 0 { 16 | if val == "true" || val == "1" { 17 | 18 | reader := auth.ReadBasicAuthFromDisk{} 19 | 20 | if val, ok := os.LookupEnv("secret_mount_path"); ok && len(val) > 0 { 21 | reader.SecretMountPath = os.Getenv("secret_mount_path") 22 | } 23 | 24 | res, err := reader.Read() 25 | if err != nil { 26 | panic(err) 27 | } 28 | credentials = res 29 | } 30 | } 31 | return credentials 32 | } 33 | -------------------------------------------------------------------------------- /types/function_list_builder.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "context" 8 | "fmt" 9 | "net/http" 10 | "net/url" 11 | "strings" 12 | 13 | "github.com/openfaas/faas-provider/auth" 14 | "github.com/openfaas/faas-provider/types" 15 | sdk "github.com/openfaas/go-sdk" 16 | ) 17 | 18 | // FunctionLookupBuilder builds a list of OpenFaaS functions 19 | type FunctionLookupBuilder struct { 20 | GatewayURL string 21 | Client *http.Client 22 | Credentials *auth.BasicAuthCredentials 23 | TopicDelimiter string 24 | sdk *sdk.Client 25 | } 26 | 27 | func NewFunctionLookupBuilder(gatewayURL, topicDelimiter string, client *http.Client, auth sdk.ClientAuth) *FunctionLookupBuilder { 28 | u, _ := url.Parse(gatewayURL) 29 | return &FunctionLookupBuilder{ 30 | sdk: sdk.NewClient(u, auth, client), 31 | TopicDelimiter: topicDelimiter, 32 | } 33 | } 34 | 35 | // Build compiles a map of topic names and functions that have 36 | // advertised to receive messages on said topic 37 | func (s *FunctionLookupBuilder) Build() (map[string][]string, error) { 38 | var err error 39 | 40 | namespaces, err := s.sdk.GetNamespaces(context.TODO()) 41 | if err != nil { 42 | return map[string][]string{}, err 43 | } 44 | 45 | serviceMap := make(map[string][]string) 46 | 47 | if len(namespaces) == 0 { 48 | namespaces = []string{""} 49 | } 50 | 51 | for _, namespace := range namespaces { 52 | functions, err := s.sdk.GetFunctions(context.TODO(), namespace) 53 | if err != nil { 54 | return map[string][]string{}, fmt.Errorf("unable to get functions in: %s, error: %w", namespace, err) 55 | } 56 | serviceMap = buildServiceMap(&functions, s.TopicDelimiter, namespace, serviceMap) 57 | } 58 | 59 | return serviceMap, err 60 | } 61 | 62 | func buildServiceMap(functions *[]types.FunctionStatus, topicDelimiter, namespace string, serviceMap map[string][]string) map[string][]string { 63 | for _, function := range *functions { 64 | 65 | if function.Annotations != nil { 66 | 67 | annotations := *function.Annotations 68 | 69 | if topicNames, exist := annotations["topic"]; exist { 70 | 71 | if len(topicDelimiter) > 0 && strings.Count(topicNames, topicDelimiter) > 0 { 72 | 73 | topicSlice := strings.Split(topicNames, topicDelimiter) 74 | 75 | for _, topic := range topicSlice { 76 | serviceMap = appendServiceMap(topic, function.Name, namespace, serviceMap) 77 | } 78 | } else { 79 | serviceMap = appendServiceMap(topicNames, function.Name, namespace, serviceMap) 80 | } 81 | } 82 | } 83 | } 84 | return serviceMap 85 | } 86 | 87 | func appendServiceMap(key, function, namespace string, sm map[string][]string) map[string][]string { 88 | 89 | key = strings.TrimSpace(key) 90 | 91 | if len(key) > 0 { 92 | 93 | if sm[key] == nil { 94 | sm[key] = []string{} 95 | } 96 | sep := "" 97 | if len(namespace) > 0 { 98 | sep = "." 99 | } 100 | 101 | functionPath := fmt.Sprintf("%s%s%s", function, sep, namespace) 102 | sm[key] = append(sm[key], functionPath) 103 | } 104 | 105 | return sm 106 | } 107 | -------------------------------------------------------------------------------- /types/function_list_builder_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Project 2018. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "encoding/json" 8 | "net/http" 9 | "net/http/httptest" 10 | "net/url" 11 | "testing" 12 | 13 | "github.com/openfaas/faas-provider/types" 14 | sdk "github.com/openfaas/go-sdk" 15 | ) 16 | 17 | func Test_BuildSingleMatchingFunction(t *testing.T) { 18 | 19 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 20 | if r.URL.Path == "/system/namespaces" { 21 | namespaces := []string{"openfaas-fn"} 22 | bytesOut, _ := json.Marshal(namespaces) 23 | _, _ = w.Write(bytesOut) 24 | } else { 25 | functions := []types.FunctionStatus{} 26 | annotationMap := make(map[string]string) 27 | annotationMap["topic"] = "topic1" 28 | 29 | functions = append(functions, types.FunctionStatus{ 30 | Name: "echo", 31 | Annotations: &annotationMap, 32 | Namespace: "openfaas-fn", 33 | }) 34 | bytesOut, _ := json.Marshal(functions) 35 | _, _ = w.Write(bytesOut) 36 | } 37 | })) 38 | 39 | u, _ := url.Parse(srv.URL) 40 | client := srv.Client() 41 | builder := FunctionLookupBuilder{ 42 | Client: client, 43 | GatewayURL: srv.URL, 44 | TopicDelimiter: ",", 45 | sdk: sdk.NewSDK(u, nil, client), 46 | } 47 | 48 | lookup, err := builder.Build() 49 | if err != nil { 50 | t.Errorf("%s", err) 51 | } 52 | if len(lookup) != 1 { 53 | t.Errorf("Lookup - want: %d items, got: %d", 1, len(lookup)) 54 | } 55 | } 56 | 57 | func Test_Build_SingleFunctionNoDelimiter(t *testing.T) { 58 | 59 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 60 | 61 | if r.URL.Path == "/system/namespaces" { 62 | namespaces := []string{"openfaas-fn"} 63 | bytesOut, _ := json.Marshal(namespaces) 64 | _, _ = w.Write(bytesOut) 65 | } else { 66 | functions := []types.FunctionStatus{} 67 | annotationMap := make(map[string]string) 68 | annotationMap["topic"] = "topic1" 69 | 70 | functions = append(functions, types.FunctionStatus{ 71 | Name: "echo", 72 | Annotations: &annotationMap, 73 | }) 74 | bytesOut, _ := json.Marshal(functions) 75 | _, _ = w.Write(bytesOut) 76 | } 77 | })) 78 | u, _ := url.Parse(srv.URL) 79 | 80 | client := srv.Client() 81 | builder := FunctionLookupBuilder{ 82 | Client: client, 83 | GatewayURL: srv.URL, 84 | sdk: sdk.NewSDK(u, nil, client), 85 | } 86 | 87 | lookup, err := builder.Build() 88 | if err != nil { 89 | t.Errorf("%s", err) 90 | } 91 | if len(lookup) != 1 { 92 | t.Errorf("Lookup - want: %d items, got: %d", 1, len(lookup)) 93 | } 94 | } 95 | 96 | func TestBuildMultiMatchingFunction(t *testing.T) { 97 | 98 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 99 | if r.URL.Path == "/system/namespaces" { 100 | namespaces := []string{"openfaas-fn"} 101 | bytesOut, _ := json.Marshal(namespaces) 102 | _, _ = w.Write(bytesOut) 103 | } else { 104 | functions := []types.FunctionStatus{} 105 | annotationMap := make(map[string]string) 106 | annotationMap["topic"] = "topic1,topic2,topic3" 107 | 108 | functions = append(functions, types.FunctionStatus{ 109 | Name: "echo", 110 | Annotations: &annotationMap, 111 | }) 112 | bytesOut, _ := json.Marshal(functions) 113 | _, _ = w.Write(bytesOut) 114 | } 115 | })) 116 | u, _ := url.Parse(srv.URL) 117 | 118 | client := srv.Client() 119 | builder := FunctionLookupBuilder{ 120 | Client: client, 121 | GatewayURL: srv.URL, 122 | TopicDelimiter: ",", 123 | sdk: sdk.NewSDK(u, nil, client), 124 | } 125 | 126 | lookup, err := builder.Build() 127 | if err != nil { 128 | t.Errorf("%s", err) 129 | } 130 | if len(lookup) != 3 { 131 | t.Errorf("Lookup - want: %d items, got: %d", 3, len(lookup)) 132 | } 133 | } 134 | 135 | func TestBuildNoFunctions(t *testing.T) { 136 | 137 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 138 | functions := []types.FunctionStatus{} 139 | bytesOut, _ := json.Marshal(functions) 140 | _, _ = w.Write(bytesOut) 141 | })) 142 | 143 | u, _ := url.Parse(srv.URL) 144 | client := srv.Client() 145 | builder := FunctionLookupBuilder{ 146 | Client: client, 147 | GatewayURL: srv.URL, 148 | TopicDelimiter: ",", 149 | sdk: sdk.NewSDK(u, nil, client), 150 | } 151 | 152 | lookup, err := builder.Build() 153 | if err != nil { 154 | t.Errorf("%s", err) 155 | } 156 | if len(lookup) != 0 { 157 | t.Errorf("Lookup - want: %d items, got: %d", 0, len(lookup)) 158 | } 159 | } 160 | 161 | func Test_Build_JustDelim(t *testing.T) { 162 | 163 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 164 | if r.URL.Path == "/system/namespaces" { 165 | namespaces := []string{"openfaas-fn"} 166 | bytesOut, _ := json.Marshal(namespaces) 167 | _, _ = w.Write(bytesOut) 168 | } else { 169 | 170 | functions := []types.FunctionStatus{} 171 | annotationMap := make(map[string]string) 172 | annotationMap["topic"] = "," 173 | 174 | functions = append(functions, types.FunctionStatus{ 175 | Name: "echo", 176 | Annotations: &annotationMap, 177 | }) 178 | bytesOut, _ := json.Marshal(functions) 179 | _, _ = w.Write(bytesOut) 180 | } 181 | })) 182 | 183 | u, _ := url.Parse(srv.URL) 184 | client := srv.Client() 185 | builder := FunctionLookupBuilder{ 186 | Client: client, 187 | GatewayURL: srv.URL, 188 | TopicDelimiter: ",", 189 | sdk: sdk.NewSDK(u, nil, client), 190 | } 191 | 192 | lookup, err := builder.Build() 193 | if err != nil { 194 | t.Errorf("%s", err) 195 | } 196 | if len(lookup) != 0 { 197 | t.Errorf("Lookup - want: %d items, got: %d", 0, len(lookup)) 198 | } 199 | } 200 | 201 | func Test_Build_MultiMatchingFunctionBespokeDelim(t *testing.T) { 202 | 203 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 204 | if r.URL.Path == "/system/namespaces" { 205 | namespaces := []string{"openfaas-fn"} 206 | bytesOut, _ := json.Marshal(namespaces) 207 | _, _ = w.Write(bytesOut) 208 | } else { 209 | functions := []types.FunctionStatus{} 210 | annotationMap := make(map[string]string) 211 | annotationMap["topic"] = "topic1|topic2|topic3,withcomma" 212 | 213 | functions = append(functions, types.FunctionStatus{ 214 | Name: "echo", 215 | Annotations: &annotationMap, 216 | }) 217 | bytesOut, _ := json.Marshal(functions) 218 | _, _ = w.Write(bytesOut) 219 | } 220 | })) 221 | 222 | u, _ := url.Parse(srv.URL) 223 | client := srv.Client() 224 | builder := FunctionLookupBuilder{ 225 | Client: client, 226 | GatewayURL: srv.URL, 227 | TopicDelimiter: "|", 228 | sdk: sdk.NewSDK(u, nil, client), 229 | } 230 | 231 | lookup, err := builder.Build() 232 | if err != nil { 233 | t.Errorf("%s", err) 234 | } 235 | if len(lookup) != 3 { 236 | t.Errorf("Lookup - want: %d items, got: %d", 3, len(lookup)) 237 | } 238 | } 239 | 240 | func Test_appendServiceMap(t *testing.T) { 241 | var TestCases = []struct { 242 | Name string 243 | Key string 244 | Function string 245 | Namespace string 246 | InputServiceMap map[string][]string 247 | ExpectedServiceMap map[string][]string 248 | }{ 249 | { 250 | Name: "Empty starting map - key with length", 251 | Key: "newKey", 252 | Function: "fnName", 253 | Namespace: "openfaas-fn", 254 | InputServiceMap: map[string][]string{}, 255 | ExpectedServiceMap: map[string][]string{ 256 | "newKey": {"fnName.openfaas-fn"}, 257 | }, 258 | }, 259 | { 260 | Name: "Empty starting map - zero key length", 261 | Key: "", 262 | Function: "fnName", 263 | Namespace: "openfaas-fn", 264 | InputServiceMap: map[string][]string{}, 265 | ExpectedServiceMap: map[string][]string{}, 266 | }, 267 | { 268 | Name: "Populated starting map - key with length", 269 | Key: "theKey", 270 | Function: "newName", 271 | Namespace: "fn", 272 | InputServiceMap: map[string][]string{"theKey": {"fnName"}}, 273 | ExpectedServiceMap: map[string][]string{ 274 | "theKey": {"fnName", "newName.fn"}, 275 | }, 276 | }, 277 | { 278 | Name: "Populated starting map - zero key length", 279 | Key: "", 280 | Function: "newName", 281 | Namespace: "fn", 282 | InputServiceMap: map[string][]string{"theKey": {"fnName"}}, 283 | ExpectedServiceMap: map[string][]string{ 284 | "theKey": {"fnName"}, 285 | }, 286 | }, 287 | { 288 | Name: "Populated starting map - new key with length", 289 | Key: "newKey", 290 | Function: "newName", 291 | Namespace: "fn", 292 | InputServiceMap: map[string][]string{"theKey": {"fnName"}}, 293 | ExpectedServiceMap: map[string][]string{ 294 | "theKey": {"fnName"}, 295 | "newKey": {"newName.fn"}, 296 | }, 297 | }, 298 | { 299 | Name: "Populated starting map - existing key new function", 300 | Key: "newKey", 301 | Function: "secondName", 302 | Namespace: "openfaas-fn", 303 | InputServiceMap: map[string][]string{"theKey": {"fnName"}, "newKey": {"newName"}}, 304 | ExpectedServiceMap: map[string][]string{ 305 | "theKey": {"fnName"}, 306 | "newKey": {"newName", "secondName.openfaas-fn"}, 307 | }, 308 | }, 309 | } 310 | 311 | for _, test := range TestCases { 312 | 313 | serviceMap := appendServiceMap(test.Key, test.Function, test.Namespace, test.InputServiceMap) 314 | 315 | if len(serviceMap) != len(test.ExpectedServiceMap) { 316 | t.Errorf("Testcase %s failed on serviceMap size. want - %d, got - %d", test.Name, len(test.ExpectedServiceMap), len(serviceMap)) 317 | } 318 | 319 | for key := range serviceMap { 320 | 321 | if _, exists := test.ExpectedServiceMap[key]; !exists { 322 | t.Errorf("Testcase %s failed on serviceMap keys. found value - %s doesnt exist in expected", test.Name, key) 323 | } 324 | 325 | if len(serviceMap[key]) != len(test.ExpectedServiceMap[key]) { 326 | t.Errorf("Testcase %s failed on key slice size. want - %d, got - %d", test.Name, len(test.ExpectedServiceMap[key]), len(serviceMap[key])) 327 | } 328 | 329 | lookupMap := make(map[string]bool) 330 | for _, fn := range serviceMap[key] { 331 | lookupMap[fn] = true 332 | } 333 | 334 | for _, v := range test.ExpectedServiceMap[key] { 335 | if _, found := lookupMap[v]; !found { 336 | t.Errorf("Testcase %s failed on key slice values. found value - %s doesnt exist in expected", test.Name, v) 337 | } 338 | } 339 | } 340 | } 341 | } 342 | 343 | func Test_BuildMultipleNamespaceFunction(t *testing.T) { 344 | 345 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 346 | if r.URL.Path == "/system/namespaces" { 347 | namespaces := []string{"openfaas-fn", "fn"} 348 | bytesOut, _ := json.Marshal(namespaces) 349 | _, _ = w.Write(bytesOut) 350 | } else { 351 | functions := []types.FunctionStatus{} 352 | annotationMap := make(map[string]string) 353 | annotationMap["topic"] = "topic1" 354 | 355 | functions = append(functions, types.FunctionStatus{ 356 | Name: "echo", 357 | Annotations: &annotationMap, 358 | Namespace: "openfaas-fn", 359 | }) 360 | bytesOut, _ := json.Marshal(functions) 361 | _, _ = w.Write(bytesOut) 362 | } 363 | })) 364 | 365 | u, _ := url.Parse(srv.URL) 366 | client := srv.Client() 367 | builder := FunctionLookupBuilder{ 368 | Client: client, 369 | GatewayURL: srv.URL, 370 | TopicDelimiter: ",", 371 | sdk: sdk.NewSDK(u, nil, http.DefaultClient), 372 | } 373 | 374 | lookup, err := builder.Build() 375 | if err != nil { 376 | t.Errorf("%s", err) 377 | } 378 | if len(lookup) != 1 { 379 | t.Errorf("Lookup - want: %d items, got: %d", 1, len(lookup)) 380 | } 381 | functions, ok := lookup["topic1"] 382 | if !ok { 383 | t.Errorf("Topic %s does not exists", "topic1") 384 | } 385 | if len(functions) != 2 { 386 | t.Errorf("Topic %s - want: %d functions, got: %d", "topic1", 2, len(functions)) 387 | } 388 | } 389 | -------------------------------------------------------------------------------- /types/invoker.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "io" 11 | "log" 12 | "net/http" 13 | "time" 14 | ) 15 | 16 | // Invoker is used to send requests to functions. Responses are 17 | // returned via the Responses channel. 18 | type Invoker struct { 19 | PrintResponse bool 20 | PrintRequest bool 21 | Client *http.Client 22 | GatewayURL string 23 | ContentType string 24 | Responses chan InvokerResponse 25 | UserAgent string 26 | } 27 | 28 | // InvokerResponse is a wrapper to contain the response or error the Invoker 29 | // receives from the function. Networking errors wil be found in the Error field. 30 | type InvokerResponse struct { 31 | Context context.Context 32 | Body *[]byte 33 | Header *http.Header 34 | Status int 35 | Error error 36 | Topic string 37 | Function string 38 | Duration time.Duration 39 | } 40 | 41 | // NewInvoker constructs an Invoker instance 42 | func NewInvoker(gatewayURL string, client *http.Client, contentType string, printResponse, printRequest bool, userAgent string) *Invoker { 43 | return &Invoker{ 44 | PrintResponse: printResponse, 45 | PrintRequest: printRequest, 46 | Client: client, 47 | GatewayURL: gatewayURL, 48 | ContentType: contentType, 49 | Responses: make(chan InvokerResponse), 50 | } 51 | } 52 | 53 | // Invoke triggers a function by accessing the API Gateway 54 | func (i *Invoker) Invoke(topicMap *TopicMap, topic string, message *[]byte, headers http.Header) { 55 | i.InvokeWithContext(context.Background(), topicMap, topic, message, headers) 56 | } 57 | 58 | // InvokeWithContext triggers a function by accessing the API Gateway while propagating context 59 | func (i *Invoker) InvokeWithContext(ctx context.Context, topicMap *TopicMap, topic string, message *[]byte, headers http.Header) { 60 | if len(*message) == 0 { 61 | i.Responses <- InvokerResponse{ 62 | Context: ctx, 63 | Error: fmt.Errorf("no message to send"), 64 | Duration: time.Millisecond * 0, 65 | } 66 | } 67 | 68 | matchedFunctions := topicMap.Match(topic) 69 | for _, matchedFunction := range matchedFunctions { 70 | log.Printf("[connector] Invoke: %s", matchedFunction) 71 | 72 | gwURL := fmt.Sprintf("%s/%s", i.GatewayURL, matchedFunction) 73 | reader := bytes.NewReader(*message) 74 | 75 | if i.PrintRequest { 76 | log.Printf("[connector] %s => %s body:\t%s", topic, matchedFunction, string(*message)) 77 | } 78 | 79 | start := time.Now() 80 | body, statusCode, header, err := i.invoke(ctx, i.Client, gwURL, i.ContentType, topic, reader, headers) 81 | if err != nil { 82 | i.Responses <- InvokerResponse{ 83 | Context: ctx, 84 | Error: fmt.Errorf("unable to invoke %s, error: %w", matchedFunction, err), 85 | Duration: time.Since(start), 86 | } 87 | continue 88 | } 89 | 90 | i.Responses <- InvokerResponse{ 91 | Context: ctx, 92 | Body: body, 93 | Status: statusCode, 94 | Header: header, 95 | Function: matchedFunction, 96 | Topic: topic, 97 | Duration: time.Since(start), 98 | } 99 | } 100 | } 101 | 102 | func (i *Invoker) invoke(ctx context.Context, c *http.Client, gwURL, contentType, topic string, reader io.Reader, headers http.Header) (*[]byte, int, *http.Header, error) { 103 | req, err := http.NewRequest(http.MethodPost, gwURL, reader) 104 | if err != nil { 105 | return nil, http.StatusServiceUnavailable, nil, err 106 | } 107 | 108 | req.Header.Set("User-Agent", i.UserAgent) 109 | 110 | if contentType != "" { 111 | req.Header.Set("Content-Type", contentType) 112 | } 113 | 114 | if v := req.Header.Get("X-Connector"); v == "" { 115 | req.Header.Set("X-Connector", "connector-sdk") 116 | } 117 | 118 | if v := req.Header.Get("X-Topic"); v == "" { 119 | req.Header.Set("X-Topic", topic) 120 | } 121 | 122 | for k, values := range headers { 123 | for _, value := range values { 124 | req.Header.Add(k, value) 125 | } 126 | } 127 | 128 | req = req.WithContext(ctx) 129 | if req.Body != nil { 130 | defer req.Body.Close() 131 | } 132 | 133 | var body *[]byte 134 | res, err := c.Do(req) 135 | if err != nil { 136 | return nil, http.StatusServiceUnavailable, nil, 137 | fmt.Errorf("unable to reach endpoint %s, error: %w", gwURL, err) 138 | } 139 | 140 | if res.Body != nil { 141 | defer res.Body.Close() 142 | 143 | bytesOut, err := io.ReadAll(res.Body) 144 | if err != nil { 145 | return nil, http.StatusServiceUnavailable, 146 | nil, 147 | fmt.Errorf("unable to read body from response %w", err) 148 | } 149 | body = &bytesOut 150 | } 151 | 152 | return body, res.StatusCode, &res.Header, err 153 | } 154 | -------------------------------------------------------------------------------- /types/make_client.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "net" 8 | "net/http" 9 | "time" 10 | ) 11 | 12 | // MakeClient returns a http.Client with a timeout for connection establishing and request handling 13 | func MakeClient(timeout time.Duration) *http.Client { 14 | return &http.Client{ 15 | Transport: &http.Transport{ 16 | Proxy: http.ProxyFromEnvironment, 17 | DialContext: (&net.Dialer{ 18 | // Timeout is the maximum amount of time a dial will wait for 19 | // a connect to complete. If Deadline is also set, it may fail 20 | // earlier. 21 | Timeout: timeout, 22 | KeepAlive: 10 * time.Second, 23 | }).DialContext, 24 | MaxIdleConns: 100, 25 | MaxIdleConnsPerHost: 100, 26 | IdleConnTimeout: 120 * time.Millisecond, 27 | }, 28 | // Timeout specifies a time limit for requests made by this 29 | // Client. The timeout includes connection time, any 30 | // redirects, and reading the response body. The timer remains 31 | // running after Get, Head, Post, or Do return and will 32 | // interrupt reading of the Response.Body. 33 | Timeout: timeout, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /types/response_printer.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "fmt" 8 | "log" 9 | ) 10 | 11 | // ResponsePrinter prints function results 12 | type ResponsePrinter struct { 13 | PrintResponseBody bool 14 | } 15 | 16 | // Response is triggered by the controller when a message is 17 | // received from the function invocation 18 | func (rp *ResponsePrinter) Response(res InvokerResponse) { 19 | if res.Error != nil { 20 | log.Printf("[connector] got error: %s", res.Error.Error()) 21 | } else { 22 | log.Printf("[connector] got result: [%d] %s => %s (%d) bytes", res.Status, res.Topic, res.Function, len(*res.Body)) 23 | if rp.PrintResponseBody { 24 | fmt.Printf("[%d] %s => %s\n%s\n", res.Status, res.Topic, res.Function, string(*res.Body)) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /types/response_subscriber.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | // ResponseSubscriber enables connector or another client in connector 7 | // to receive results from the function invocation. 8 | // Note: when implementing this interface, you must not perform any 9 | // costly or high-latency operations, or should off-load them to another 10 | // go-routine to prevent blocking. 11 | type ResponseSubscriber interface { 12 | // Response is triggered by the controller when a message is 13 | // received from the function invocation 14 | Response(InvokerResponse) 15 | } 16 | -------------------------------------------------------------------------------- /types/topic_map.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) OpenFaaS Author(s) 2019. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | package types 5 | 6 | import ( 7 | "sync" 8 | ) 9 | 10 | func NewTopicMap() TopicMap { 11 | lookup := make(map[string][]string) 12 | return TopicMap{ 13 | lookup: &lookup, 14 | lock: sync.RWMutex{}, 15 | } 16 | } 17 | 18 | type TopicMap struct { 19 | lookup *map[string][]string 20 | lock sync.RWMutex 21 | } 22 | 23 | func (t *TopicMap) Match(topicName string) []string { 24 | t.lock.RLock() 25 | defer t.lock.RUnlock() 26 | 27 | var values []string 28 | 29 | for key, val := range *t.lookup { 30 | if key == topicName { 31 | values = val 32 | break 33 | } 34 | } 35 | 36 | return values 37 | } 38 | 39 | func (t *TopicMap) Sync(updated *map[string][]string) { 40 | t.lock.Lock() 41 | defer t.lock.Unlock() 42 | 43 | t.lookup = updated 44 | } 45 | 46 | func (t *TopicMap) Topics() []string { 47 | t.lock.RLock() 48 | defer t.lock.RUnlock() 49 | 50 | topics := make([]string, 0, len(*t.lookup)) 51 | for topic := range *t.lookup { 52 | topics = append(topics, topic) 53 | } 54 | 55 | return topics 56 | } 57 | --------------------------------------------------------------------------------