examples/

directory
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2018 License: BSD-3-Clause

README

Examples

The packages in this directory are example illustrating how to use Shisa.

Architecture

design

Services

  • gw - A Shisa implemenation talking to the rest and rpc services.
  • rest - A "legacy" RESTful web service implementing the "Goodbye" service
  • rpc - A "modern" RPC service implementing the "Hello" service
  • idp - An Identity Provider service used by the other services.

Building

To build all the service program files run the following from the project root:

make examples

Running

Each service must run on a unique port or on a separate (virtual) machine. To run on a single host, run the following commands from the project root. Adjust the port numbers (or addreses) as needed to suit your environment.

  1. Start idp

    bin/idp -addr ":9601"
    
  2. Start rest

    export IDP_SERVICE_ADDR=":9601"
    bin/rest -addr ":9501"
    
  3. Start rpc:

    export IDP_SERVICE_ADDR=":9601"
    bin/rpc -addr ":9401"
    
  4. Start gw:

    export IDP_SERVICE_ADDR=":9601"
    export GOODBYE_SERVICE_ADDR=":9501"
    export HELLO_SERVICE_ADDR=":9401"
    bin/gw -addr ":9001"
    

You can now access these URLs for the services:

IdP
Goodbye
Hello
API Gateway

The healthcheck and debug endpoints require authentication by the "admin" user: Admin:password. The api/greeting and api/farewell endpoints can be accessed by the "admin" user or Boss:password.

Directories

Path Synopsis
idp
rpc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL