greeter

command
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 19 Imported by: 0

README

Greeter Service

This is the Greeter service

Showcase

  1. Async service

Usage

Build the binary
make build TARGET=greeter TYPE=service
# then run with custom env
CONFIG_ENV_PREFIX=APP APP_FEATURES_TLS_ENABLED=true ./build/greeter-service
Run the service
make run-greeter
# or
go run service/greeter/main.go
Build a docker image
make docker TARGET=greeter TYPE=service VERSION=v0.1.1
Test the service
  1. start greeter service make run-greeter
  2. start envoy via docker-compose docker-compose up envoy or docker-compose up envoy_http or docker-compose up envoy_secure_backend when tls is enabled in config.yaml

envoy via docker-compose will be exposing '9901', '9090', '9444' ports

test API directly (go greeter)
### plaintext ###
grpcurl -plaintext -proto proto/mkit/service/greeter/v1/greeter.proto list
grpcurl -plaintext -proto proto/mkit/service/greeter/v1/greeter.proto describe
grpcurl -plaintext -proto proto/mkit/service/greeter/v1/greeter.proto -d '{"name": "sumo"}' localhost:8081  mkit.service.greeter.v1.GreeterService/Hello
# OR
grpcurl -plaintext \
-protoset <(buf image build -o -) \
-d '{"name": "sumo"}' 0.0.0.0:8081 mkit.service.greeter.v1.GreeterService/Hello

### TLS ###
grpcurl -insecure \
-protoset <(buf image build -o -) \
-d '{"name": "sumo"}' 0.0.0.0:8081 mkit.service.greeter.v1.GreeterService/Hello
test API via envoy
### plaintext ###
# with `docker-compose up envoy_http`
grpcurl -plaintext  \
-protoset <(buf image build -o -) \
-d '{"name": "sumo"}' 0.0.0.0:9090 mkit.service.greeter.v1.GreeterService/Hello

### TLS ###
grpcurl -cacert=config/certs/ca-cert.pem \
-protoset <(buf image build -o -) \
-d '{"name": "sumo"}' localhost:9444 mkit.service.greeter.v1.GreeterService/Hello

For full examples, see Testing with grpcurl

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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