bcho fix(example/shipping): header should set before `WriteHeader`
From `net/http`:

    Changing the header map after a call to WriteHeader (or Write)
    has no effect unless the modified headers are trailers.

To send the `content-type`, need to set before calling `WriteHeader`.

Fixes #537
Latest commit 8392035 May 26, 2017



This example demonstrates a more real-world application consisting of multiple services.


The implementation is based on the container shipping domain from the Domain Driven Design book by Eric Evans, which was originally implemented in Java but has since been ported to Go. This example is a somewhat stripped down version to demonstrate the use of Go kit. The original Go application is maintained separately and accompanied by an AngularJS application as well as a mock routing service.


The application consists of three application services, booking, handling and tracking. Each of these is an individual Go kit service as seen in previous examples.

  • booking - used by the shipping company to book and route cargos.
  • handling - used by our staff around the world to register whenever the cargo has been received, loaded etc.
  • tracking - used by the customer to track the cargo along the route

There are also a few pure domain packages that contain some intricate business-logic. They provide domain objects and services that are used by each application service to provide interesting use-cases for the user.

inmem contains in-memory implementations for the repositories found in the domain packages.

The routing package provides a domain service that is used to query an external application for possible routes.


As with all Go kit examples you are more than welcome to contribute. If you do however, please consider contributing back to the original project as well.