examples

module
v0.0.0-...-e01b0a5 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: Apache-2.0

README

Micro Examples Travis CI Go Report Card

This is a repository for micro examples. Feel free to contribute.

Contents

  • greeter - A complete greeter example (includes python, ruby examples)
  • sidecar - Greeter service using the sidecar with multiple languages
  • booking - A booking.com demo application
  • plugins - How to use plugins
  • broker - A example of using Broker for Publish and Subscribing.
  • client - Usage of the Client package to call a service.
  • graceful - Demonstrates graceful shutdown of a service
  • redirect - An example of how to http redirect using an API service
  • server - Use of the Server package directly to server requests.
  • service - Example of the top level Service in go-micro.
  • shutdown - Demonstrates graceful shutdown via context cancellation
  • template - Api, web and srv service templates generated with the 'micro new' command
  • grpc - Examples of how to use go-grpc

External

  • auth-srv - An Oauth2 authentication service
  • geo-srv - Geolocation tracking service using hailocab/go-geoindex
  • geo-web - Web demo for the geo srv
  • geo-api - API for the geo srv
  • discovery-srv - A discovery in the micro platform
  • geocode-srv - A geocoding service using the Google Geocoding API
  • hailo-srv - A service for the hailo taxi service developer api
  • monitor-srv - A monitoring service for Micro services
  • place-srv - A microservice to store and retrieve places (includes Google Place Search API)
  • slack-srv - The slack bot API as a go-micro RPC service
  • trace-srv - A distributed tracing microservice in the realm of dapper, zipkin, etc
  • twitter-srv - A microservice for the twitter API
  • user-srv - A microservice for user management and authentication

Dependencies

Service Discovery

All services require service discovery. The default is Consul or MDNS.

Consul

Install

brew install consul

Run

consul agent -dev
Multicast DNS

Use flag --registry=mdns for a zero dependency configuration

Protobuf

Protobuf is used for code generation of message types and client/hander stubs.

If making changes recompile the protos.

Install
go get github.com/micro/protobuf/{proto,protoc-gen-go}
Compile Proto
protoc -I$GOPATH/src --go_out=plugins=micro:$GOPATH/src \
        $GOPATH/src/github.com/micro/examples/service/proto/greeter.proto

Directories

Path Synopsis
booking
api/hotel/proto
Package hotel is a generated protocol buffer package.
Package hotel is a generated protocol buffer package.
srv/auth/proto
Package auth is a generated protocol buffer package.
Package auth is a generated protocol buffer package.
srv/geo/proto
Package geo is a generated protocol buffer package.
Package geo is a generated protocol buffer package.
srv/profile/proto
Package profile is a generated protocol buffer package.
Package profile is a generated protocol buffer package.
srv/rate/proto
Package rate is a generated protocol buffer package.
Package rate is a generated protocol buffer package.
pub
greeter
api
api/rpc/proto/hello
Package go_micro_api_greeter is a generated protocol buffer package.
Package go_micro_api_greeter is a generated protocol buffer package.
cli
srv
srv/proto/hello
Package go_micro_srv_greeter is a generated protocol buffer package.
Package go_micro_srv_greeter is a generated protocol buffer package.
web
grpc
greeter/srv/proto/hello
Package go_micro_srv_greeter is a generated protocol buffer package.
Package go_micro_srv_greeter is a generated protocol buffer package.
proto/example
Package go_micro_srv_example is a generated protocol buffer package.
Package go_micro_srv_example is a generated protocol buffer package.
proto
Package greeter is a generated protocol buffer package.
Package greeter is a generated protocol buffer package.
sidecar
go
+build main1
+build main1
template
api
api/proto/example
Package go_micro_api_template is a generated protocol buffer package.
Package go_micro_api_template is a generated protocol buffer package.
srv
srv/proto/example
Package go_micro_srv_template is a generated protocol buffer package.
Package go_micro_srv_template is a generated protocol buffer package.
web

Jump to

Keyboard shortcuts

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