examples

module
v0.0.0-...-fd3316e Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0

README

Examples

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

Contents

  • api - Provides API usage examples
  • blog - Full end to end multi-service blog application
  • booking - A booking.com demo application
  • broker - A example of using Broker for Publish and Subscribing.
  • client - Usage of the Client package to call a service.
  • command - An example of bot commands as micro services
  • config - Using Go Config for dynamic config
  • event - Using the API Gateway event handler
  • filter - Filter nodes of a service when requesting
  • flags - Using command line flags with a service
  • form - How to parse a form behind the micro api
  • function - Example of using Function programming model
  • getip - Get the local and remote ip from metadata
  • graceful - Demonstrates graceful shutdown of a service
  • greeter - A complete greeter example (includes python, ruby examples)
  • heartbeat - Make services heartbeat with discovery for high availability
  • helloworld - Hello world using micro
  • kubernetes - Examples of using the k8s registry and grpc
  • metadata - Extracting metadata from context of a request
  • mocking - Demonstrate mocking helloworld service
  • noproto - Use micro without protobuf or code generation, only go types
  • options - Setting options in the go-micro framework
  • plugins - How to use plugins
  • pubsub - Example of using pubsub at the client/server level
  • grpc - Examples of how to use go-micro/service/grpc
  • redirect - An example of how to http redirect using an API service
  • roundrobin - A stateful client wrapper for true round robin of requests
  • secure - Demonstrates use of transport secure option for self signed certs
  • server - Use of the Server package directly to server requests.
  • service - Example of the top level Service in go-micro.
  • sharding - An example of how to shard requests or use session affinity
  • shutdown - Demonstrates graceful shutdown via context cancellation
  • stream - An example of a streaming service and client
  • template - Api, web and srv service templates generated with the 'micro new' command
  • tunnel - How to use connection tunneling with the tunnel package
  • waitgroup - Demonstrates how to use a waitgroup with a service
  • wrapper - A simple example of using a log wrapper

Install

Install protoc for your environment. Then:

# install protoc-gen-go
go get github.com/golang/protobuf/{proto,protoc-gen-go}
# install protoc-gen-micro
go get github.com/micro/micro/v2/cmd/protoc-gen-micro@master

To recompile any proto after changes:

protoc --proto_path=$GOPATH/src:. --micro_out=. --go_out=. path/to/proto

Directories

Path Synopsis
api
meta/proto
Package api is a generated protocol buffer package.
Package api is a generated protocol buffer package.
rpc
rpc/proto
Package api is a generated protocol buffer package.
Package api is a generated protocol buffer package.
blog
comment Module
search Module
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
config
event
srv
srv/proto
Package pubsub is a generated protocol buffer package.
Package pubsub is a generated protocol buffer package.
version
Package version provides a way of calling a version of a service
Package version provides a way of calling a version of a service
form
api
web
proto
Package greeter is a generated protocol buffer package.
Package greeter is a generated protocol buffer package.
proto/hello
Package greeter is a generated protocol buffer package.
Package greeter is a generated protocol buffer package.
proto
Package greeter is a generated protocol buffer package.
Package greeter is a generated protocol buffer package.
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
Package main
Package main
web
helloworld module
kubernetes
go/config
Package config implements go-config with env and k8s configmap
Package config implements go-config with env and k8s configmap
go/micro
Package micro implements a go-micro service for k8s
Package micro implements a go-micro service for k8s
metadata
cli
srv
plugins
prefix
Package prefix is a micro plugin for stripping a path prefix
Package prefix is a micro plugin for stripping a path prefix
proxy
go
pubsub
cli
srv
srv/proto
Package pubsub is a generated protocol buffer package.
Package pubsub is a generated protocol buffer package.
secure
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.
proto/example
Package go_micro_srv_example is a generated protocol buffer package.
Package go_micro_srv_example is a generated protocol buffer package.
stream
server/proto
Package stream is a generated protocol buffer package.
Package stream is a generated protocol buffer package.
web
template
api
fnc
fnc/proto/example
Package go_micro_fnc_template is a generated protocol buffer package.
Package go_micro_fnc_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
cli

Jump to

Keyboard shortcuts

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