Skip to content

Update links to examples #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions _src/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ Here you can find some examples that will orient you to Go kit idioms,
writing a service from first principles. It can help you understand
the decisions that went into Go kit's design.

- **[addsvc](https://github.com/go-kit/kit/blob/master/examples/addsvc)**
- **[addsvc](https://github.com/go-kit/examples/blob/master/addsvc)**
is the original example service.
It exposes a set of operations over all supported transports.
It's fully logged, instrumented, and uses distributed tracing.
It also demonstrates how to create and use client packages.
It demonstrates almost all of Go kit's features.

- **[profilesvc](https://github.com/go-kit/kit/blob/master/examples/profilesvc)**
- **[profilesvc](https://github.com/go-kit/examples/blob/master/profilesvc)**
demonstrates how to use Go kit
to write a microservice with a REST-ish API.
It uses net/http and the excellent Gorilla web toolkit.

- **[shipping](https://github.com/go-kit/kit/blob/master/examples/shipping)**
- **[shipping](https://github.com/go-kit/examples/blob/master/shipping)**
is a complete, "real-world" application composed of multiple microservices,
based on Domain Driven Design principles.

- **[apigateway](https://github.com/go-kit/kit/blob/master/examples/apigateway)**
- **[apigateway](https://github.com/go-kit/examples/blob/master/apigateway)**
demonstrates how to implement the [API gateway pattern](http://microservices.io/patterns/apigateway.html)
backed by a Consul service discovery system.
12 changes: 6 additions & 6 deletions _src/examples/stringsvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func encodeResponse(_ context.Context, w http.ResponseWriter, response interface

## stringsvc1

The complete service so far is [stringsvc1](https://github.com/go-kit/kit/blob/master/examples/stringsvc1).
The complete service so far is [stringsvc1](https://github.com/go-kit/examples/blob/master/stringsvc1).

```
$ go get github.com/go-kit/kit/examples/stringsvc1
Expand All @@ -200,7 +200,7 @@ No service can be considered production-ready without thorough logging and instr
## Separation of concerns

Separating each layer of the call graph into individual files makes a go-kit project easier to read as you increase the number of service endpoints.
Our first example [stringsvc1](https://github.com/go-kit/kit/blob/master/examples/stringsvc1) had all of these layers in a single main file.
Our first example [stringsvc1](https://github.com/go-kit/examples/blob/master/stringsvc1) had all of these layers in a single main file.
Before we add more complexity, let's separate our code into the following files and leave all remaining code in main.go

Place your **services** into a service.go file with the following functions and types.
Expand Down Expand Up @@ -475,7 +475,7 @@ func main() {

## stringsvc2

The complete service so far is [stringsvc2](https://github.com/go-kit/kit/blob/master/examples/stringsvc2).
The complete service so far is [stringsvc2](https://github.com/go-kit/examples/blob/master/stringsvc2).

```
$ go get github.com/go-kit/kit/examples/stringsvc2
Expand Down Expand Up @@ -661,7 +661,7 @@ func proxyingMiddleware(instances string, logger log.Logger) ServiceMiddleware {

## stringsvc3

The complete service so far is [stringsvc3](https://github.com/go-kit/kit/blob/master/examples/stringsvc3).
The complete service so far is [stringsvc3](https://github.com/go-kit/examples/blob/master/stringsvc3).

```
$ go get github.com/go-kit/kit/examples/stringsvc3
Expand Down Expand Up @@ -728,6 +728,6 @@ It's possible to use Go kit to create a client package to your service,
to make consuming your service easier from other Go programs.
Effectively, your client package will provide an implementation of your service interface,
which invokes a remote service instance using a specific transport.
See [addsvc/cmd/addcli](https://github.com/go-kit/kit/blob/master/examples/addsvc/cmd/addcli)
or [package profilesvc/client](https://github.com/go-kit/kit/blob/master/examples/profilesvc/client)
See [addsvc/cmd/addcli](https://github.com/go-kit/examples/blob/master/addsvc/cmd/addcli)
or [package profilesvc/client](https://github.com/go-kit/examples/blob/master/profilesvc/client)
for examples.
2 changes: 1 addition & 1 deletion _src/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ It's unlikely that a business-domain error from your service
should cause a circuit breaker to trip in a client.
So, it's likely that you want to encode errors in your response struct.

[addsvc](http://github.com/go-kit/kit/tree/master/examples/addsvc)
[addsvc](http://github.com/go-kit/examples/tree/master/addsvc)
contains examples of both methods.

# More specific topics
Expand Down