-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
will the conference WiFi work?? or will it fail?? NO ONE CAN POSSIBLY…
… KNOW.
- Loading branch information
1 parent
1650425
commit 31d3d1a
Showing
14 changed files
with
136 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
"strings" | ||
|
||
"github.com/nats-io/nats.go" | ||
services "github.com/nats-io/nats.go/micro" | ||
) | ||
|
||
func main() { | ||
ctx := context.Background() | ||
|
||
natsUrl := os.Getenv("NATS_URL") | ||
if len(strings.TrimSpace(natsUrl)) == 0 { | ||
natsUrl = nats.DefaultURL | ||
} | ||
fmt.Printf("Using NATS url '%s'", natsUrl) | ||
nc, err := nats.Connect(natsUrl) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// request handler | ||
echoHandler := func(req services.Request) { | ||
req.Respond(req.Data()) | ||
} | ||
|
||
_, err = services.AddService(nc, services.Config{ | ||
Name: "EchoService", | ||
Version: "1.0.0", | ||
// base handler | ||
Endpoint: &services.EndpointConfig{ | ||
Subject: "svc.echo", | ||
Handler: services.HandlerFunc(echoHandler), | ||
}, | ||
}) | ||
|
||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
<-ctx.Done() | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.