1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00
go-micro/examples/service
2016-02-07 21:30:18 +00:00
..
proto Update top level init 2016-01-01 01:16:21 +00:00
wrapper Move context to metadata 2016-01-28 17:55:28 +00:00
main.go update client 2016-01-02 23:15:57 +00:00
README.md Update readme for consul syntax changes 2016-02-07 21:30:18 +00:00

Service

This is an example of creating a micro service using the top level interface.

Prereqs

Micro services need a discovery system so they can find each other. Micro uses consul by default but its easily swapped out with etcd, kubernetes, or various other systems. We'll run consul for convenience.

  1. Follow the install instructions - https://www.consul.io/intro/getting-started/install.html

  2. Run Consul

$ consul agent -dev -advertise=127.0.0.1

Run the example

  1. Get the service
go get github.com/micro/go-micro/examples/service
  1. Run the server
$GOPATH/bin/service
  1. Run the client
$GOPATH/bin/service --client

And that's all there is to it.