Skip to content

Commit

Permalink
Upgrade golang-basic to chi@v5 and [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Nov 14, 2022
1 parent 7e1449e commit 7fc199d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions _examples/golang-basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ to your service
4. From the inputs and outputs for the function definitions, start writing the "messages"
section of the data types needed in your program.
5. Run the code generator to build the server and client:
* `webrpc-gen -schema=example.ridl -target=go -pkg=main -server -client -out=./example.gen.go`
* or... * `webrpc-gen -schema=example.webrpc.json -target=go -pkg=main -server -client -out=./example.gen.go`
* `webrpc-gen -schema=example.ridl -target=golang -pkg=main -server -client -out=./example.gen.go`
* or... * `webrpc-gen -schema=example.webrpc.json -target=golang -pkg=main -server -client -out=./example.gen.go`
* however, in this example we put it inside a `go:generate`, so you can run `go generate .`
6. Write your server ([./main.go](./main.go)) and implement the `ExampleServiceRPC` interface type
that was created by the code generator, and located in the [gen'd file](./example.gen.go).
7. Enjoy!

Next steps, you can generate a Typescript client by running:
* `webrpc-gen -schema=example.ridl -target=ts -pkg=example -client -out=./example-client.ts`
* `webrpc-gen -schema=example.ridl -target=typescript -client -out=./example-client.ts`
* check out the [hello-webrpc](../hello-webrpc) for an example with a Webapp client talking to a webrpc backend


Expand Down
2 changes: 1 addition & 1 deletion _examples/golang-basics/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module golang-basics
go 1.19

require (
github.com/go-chi/chi v1.5.4
github.com/go-chi/chi/v5 v5.0.7
github.com/stretchr/testify v1.8.1
)

Expand Down
4 changes: 2 additions & 2 deletions _examples/golang-basics/go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-chi/chi v1.5.4 h1:QHdzF2szwjqVV4wmByUnTcsbIg7UGaQ0tPF2t5GcAIs=
github.com/go-chi/chi v1.5.4/go.mod h1:uaf8YgoFazUOkPBG7fxPftUylNumIev9awIWOENIuEg=
github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8=
github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
4 changes: 2 additions & 2 deletions _examples/golang-basics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"log"
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
)

func main() {
Expand Down

0 comments on commit 7fc199d

Please sign in to comment.