nitro-examples

module
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0

README

Nitro Examples

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

Contents

  • broker - A example of using Broker for Publish and Subscribing.
  • client - Usage of the Client package to call a service.
  • config - Using Go Config for dynamic config
  • graceful - Demonstrates graceful shutdown of a service
  • helloworld - Hello world using micro
  • noproto - Use micro without protobuf or code generation, only go types
  • options - Setting options in the go-micro framework
  • 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
  • waitgroup - Demonstrates how to use a waitgroup with a service

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
consumer command
producer command
config
file command
client command
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
client command
server command
server/proto
Package stream is a generated protocol buffer package.
Package stream is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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