greeter

command
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 11 Imported by: 0

README

Greeter Service

This is the Greeter service

Configuration

  • FQDN: greeter_srv
  • Type: srv
  • Alias: greeter

Usage

A Makefile is included for convenience

Build the binary

make build TARGET=greeter TYPE=srv VERSION=v0.1.1

Run the service

make run-greeter
# or
go run srv/greeter/main.go srv/greeter/plugin.go --configDir deploy/bases/greeter_srv/config

Build a docker image

make docker TARGET=greeter TYPE=srv VERSION=v0.1.1
Test
# start the server on fixed port
make run-greeter ARGS="--server_address=localhost:8080"

# test with grpc cli
grpc_cli call localhost:8080 Greeter.Hello  'name: "sumo"'  --protofiles=srv/greeter/proto/greeter/greeter.proto

# testing via micro-cli
micro --client=grpc call greeter_srv Greeter.Hello  '{"name": "John"}'

# start REST gateway
micro api --enable_rpc=true

# testing via rest proxy
curl --request POST \
--url http://localhost:8080/rpc \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"service": "greeter_srv", "method": "Greeter.Hello","request": {"name": "sumo"}}'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
proto

Jump to

Keyboard shortcuts

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