diff --git a/README.md b/README.md index 60c8941..56876a2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Try it out and let us know what you think! If you notice any bugs or have any fe First, add the library to your Go project: ```console -go get github.com/kubetail-org/grpc-dispatcher +go get github.com/kubetail-org/grpc-dispatcher-go ``` Next write your dispatch code: @@ -26,7 +26,7 @@ Next write your dispatch code: import ( "context" - "github.com/kubetail-org/grpc-dispatcher" + "github.com/kubetail-org/grpc-dispatcher-go" "google.golang.org/grpc" ) @@ -99,7 +99,7 @@ func main() { ## Docs -See [Go docs](https://pkg.go.dev/github.com/kubetail-org/grpc-dispatcher) for library documentation. +See [Go docs](https://pkg.go.dev/github.com/kubetail-org/grpc-dispatcher-go) for library documentation. ## Example diff --git a/example/cmd/app/main.go b/example/cmd/app/main.go index b78503d..4168616 100644 --- a/example/cmd/app/main.go +++ b/example/cmd/app/main.go @@ -23,7 +23,7 @@ import ( "syscall" "time" - "github.com/kubetail-org/grpc-dispatcher/example/internal/app" + "github.com/kubetail-org/grpc-dispatcher-go/example/internal/app" ) func main() { @@ -35,7 +35,7 @@ func main() { // create app app, err := app.NewApp() if err != nil { - log.Fatal(err) + log.Fatalf("Error: %v", err) } // create server @@ -51,7 +51,7 @@ func main() { go func() { log.Println("Starting server on :4000") if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed { - log.Fatal(err) + log.Fatalf("Error: %v", err) } }() @@ -68,7 +68,7 @@ func main() { done := make(chan struct{}) go func() { if err := server.Shutdown(ctx); err != nil { - log.Println(err) + log.Printf("Error: %v", err) } close(done) }() diff --git a/example/cmd/server/main.go b/example/cmd/server/main.go index 07aa715..ad75a0f 100644 --- a/example/cmd/server/main.go +++ b/example/cmd/server/main.go @@ -26,7 +26,7 @@ import ( "google.golang.org/grpc" - "github.com/kubetail-org/grpc-dispatcher/example/internal/examplepb" + "github.com/kubetail-org/grpc-dispatcher-go/example/internal/examplepb" ) type ExampleService struct { diff --git a/example/go.mod b/example/go.mod index a1e8baa..957466d 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,15 +1,15 @@ -module github.com/kubetail-org/grpc-dispatcher/example +module github.com/kubetail-org/grpc-dispatcher-go/example go 1.22.5 require ( github.com/gin-gonic/gin v1.10.0 - github.com/kubetail-org/grpc-dispatcher v0.0.0 + github.com/kubetail-org/grpc-dispatcher-go v0.0.0 google.golang.org/grpc v1.66.0 google.golang.org/protobuf v1.34.2 ) -replace github.com/kubetail-org/grpc-dispatcher => ../ +replace github.com/kubetail-org/grpc-dispatcher-go => ../ require ( github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect diff --git a/example/internal/app/app.go b/example/internal/app/app.go index e3d4cc3..0431956 100644 --- a/example/internal/app/app.go +++ b/example/internal/app/app.go @@ -25,8 +25,8 @@ import ( "time" "github.com/gin-gonic/gin" - grpcdispatcher "github.com/kubetail-org/grpc-dispatcher" - "github.com/kubetail-org/grpc-dispatcher/example/internal/examplepb" + grpcdispatcher "github.com/kubetail-org/grpc-dispatcher-go" + "github.com/kubetail-org/grpc-dispatcher-go/example/internal/examplepb" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -99,7 +99,7 @@ func NewApp() (*App, error) { // execute grpc request resp, err := client.Echo(ctx, &examplepb.EchoRequest{Message: "hello", DurationMs: 0}) if err != nil { - fmt.Println(err) + log.Printf("Error: %v", err) return } @@ -135,7 +135,7 @@ func NewApp() (*App, error) { // execute grpc request resp, err := client.Echo(ctx, &examplepb.EchoRequest{Message: "hello", DurationMs: 0}) if err != nil { - fmt.Println(err) + log.Printf("Error: %v", err) return } diff --git a/example/templates/index.html b/example/templates/index.html index b16b41c..5d48348 100644 --- a/example/templates/index.html +++ b/example/templates/index.html @@ -5,8 +5,13 @@