Skip to content

Commit

Permalink
Merge pull request #1129 from sagikazarmark/improve-example-references
Browse files Browse the repository at this point in the history
Improve example references
  • Loading branch information
sagikazarmark authored Jul 2, 2021
2 parents d19ee33 + 4c47fd8 commit a6c5d58
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
examples/addsvc/addsvc
examples/addsvc/client/client
examples/apigateway/apigateway
examples/profilesvc/profilesvc
examples/stringsvc1/stringsvc1
examples/stringsvc2/stringsvc2
examples/stringsvc3/stringsvc3
*.coverprofile

# Compiled Object files, Static and Dynamic libs (Shared Objects)
Expand Down
2 changes: 1 addition & 1 deletion tracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Go kit instrumentation can be found in [opentelemetry-go-contrib]
which is a central repository of instrumentation libraries.

[Dapper]: http://research.google.com/pubs/pub36356.html
[addsvc]:https://github.com/go-kit/kit/tree/master/examples/addsvc
[addsvc]: https://github.com/go-kit/examples/tree/master/addsvc
[README]: https://github.com/go-kit/kit/blob/master/tracing/zipkin/README.md

[OpenTracing]: http://opentracing.io
Expand Down
2 changes: 1 addition & 1 deletion tracing/zipkin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tracer, err = zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(localEndpoint)
```

[zipkin-go]: https://github.com/openzipkin/zipkin-go
[addsvc]:https://github.com/go-kit/kit/tree/master/examples/addsvc
[addsvc]: https://github.com/go-kit/examples/tree/master/addsvc
[Log]: https://github.com/go-kit/kit/tree/master/log

### Tracing Resources
Expand Down
6 changes: 3 additions & 3 deletions transport/grpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Using gRPC and go-kit together is very simple.
First, define your service using protobuf3. This is explained
[in gRPC documentation](http://www.grpc.io/docs/#defining-a-service).
See
[add.proto](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/pb/add.proto)
[addsvc.proto](https://github.com/go-kit/examples/blob/master/addsvc/pb/addsvc.proto)
for an example. Make sure the proto definition matches your service's go-kit
(interface) definition.

Expand Down Expand Up @@ -43,12 +43,12 @@ protoc add.proto --go_out=plugins=grpc:.
Finally, write a tiny binding from your service definition to the gRPC
definition. It's a simple conversion from one domain to another.
See
[grpc_binding.go](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/grpc_binding.go)
[grpc.go](https://github.com/go-kit/examples/blob/master/addsvc/pkg/addtransport/grpc.go)
for an example.

That's it!
The gRPC binding can be bound to a listener and serve normal gRPC requests.
And within your service, you can use standard go-kit components and idioms.
See [addsvc](https://github.com/go-kit/examples/blob/master/addsvc/) for
See [addsvc](https://github.com/go-kit/examples/tree/master/addsvc/) for
a complete working example with gRPC support. And remember: go-kit services
can support multiple transports simultaneously.
2 changes: 1 addition & 1 deletion transport/netrpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ See [netrpc_binding.go](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a
That's it!
The net/rpc binding can be registered to a name, and bound to an HTTP handler, the same as any other net/rpc endpoint.
And within your service, you can use standard Go kit components and idioms.
See [addsvc](https://github.com/go-kit/kit/tree/master/examples/addsvc) for a complete working example with net/rpc support.
See [addsvc](https://github.com/go-kit/examples/tree/master/addsvc) for a complete working example with net/rpc support.
And remember: Go kit services can support multiple transports simultaneously.
6 changes: 3 additions & 3 deletions transport/thrift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ And using Thrift with Go kit is very simple.

First, define your service in the Thrift IDL.
The [Thrift IDL documentation](https://thrift.apache.org/docs/idl) provides more details.
See [add.thrift](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/_thrift/add.thrift) for an example.
See [addsvc.thrift](https://github.com/go-kit/examples/blob/master/addsvc/thrift/addsvc.thrift) for an example.
Make sure the Thrift definition matches your service's Go kit (interface) definition.

Next, [download Thrift](https://thrift.apache.org/download) and [install the compiler](https://thrift.apache.org/docs/install/).
Expand All @@ -22,11 +22,11 @@ thrift -r --gen go:package_prefix=github.com/my-org/my-repo/thrift/gen-go/ add.t

Finally, write a tiny binding from your service definition to the Thrift definition.
It's a straightforward conversion from one domain to the other.
See [thrift_binding.go](https://github.com/go-kit/kit/blob/ec8b02591ee873433565a1ae9d317353412d1d27/examples/addsvc/thrift_binding.go) for an example.
See [thrift.go](https://github.com/go-kit/examples/blob/master/addsvc/pkg/addtransport/thrift.go) for an example.

That's it!
The Thrift binding can be bound to a listener and serve normal Thrift requests.
And within your service, you can use standard Go kit components and idioms.
Unfortunately, setting up a Thrift listener is rather laborious and nonidiomatic in Go.
Fortunately, [addsvc](https://github.com/go-kit/kit/tree/master/examples/addsvc) is a complete working example with Thrift support.
Fortunately, [addsvc](https://github.com/go-kit/examples/tree/master/addsvc) is a complete working example with Thrift support.
And remember: Go kit services can support multiple transports simultaneously.

0 comments on commit a6c5d58

Please sign in to comment.