This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| user object: | |
| { | |
| "id": "some-user-id", | |
| "email": [email protected], | |
| "is_verified": false | |
| } | |
| */ | |
| package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| user object: | |
| { | |
| "id": "some-user-id", | |
| "email": [email protected], | |
| "is_verified": false | |
| } | |
| */ | |
| package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| var timeit = func() func() { | |
| start := time.Now() | |
| return func() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/sequential.txt b/concurrent.txt | |
| similarity index 56% | |
| rename from sequential.txt | |
| rename to concurrent.txt | |
| index 7635f4e..0dd617e 100644 | |
| --- a/sequential.txt | |
| +++ b/concurrent.txt | |
| @@ -9,18 +9,18 @@ Timeout: 10s | |
| RESULT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| rowCh := make(chan *sql.Rows, 1) | |
| errCh := make(chan error, 1) | |
| go func() { | |
| row, err := db.Client.QueryContext( | |
| ctx, | |
| qs, | |
| ... | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| row, err := db.Client.QueryContext( | |
| ctx, | |
| qs, | |
| ... | |
| ) | |
| ... // check for error and close the row |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package consul | |
| import ( | |
| "fmt" | |
| "log" | |
| consulApi "github.com/by-sabbir/consul-kv-discovery/pkg/consul" | |
| ) | |
| type ServiceDefinition struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| consulApi "github.com/by-sabbir/consul-kv-discovery/pkg/consul" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package consul | |
| import ( | |
| "log" | |
| "github.com/hashicorp/consul/api" | |
| ) | |
| type KVClient struct { | |
| *api.KV |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| consul: | |
| image: hashicorp/consul:1.10.0 | |
| restart: always | |
| volumes: | |
| - ./conf/server.json:/consul/config/server.json:ro | |
| ports: | |
| - 8500:8500 |
NewerOlder