Skip to content

yaiio/go-micro-helloworld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

go-micro-helloworld

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/yaiio/go-micro-helloworld/hello-micro-world
  1. Run the server
$GOPATH/bin/hello-micro-world
  1. Run the client
$GOPATH/bin/greeting world

And that's all there is to it.