go-grpc-user

module
v0.0.0-...-2bef4cf Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT

README

Serviço de usuário utilizando Go e GRPC

Serviços

  • Server
  • Client
  • Gateway

Requisitos

API

All
curl --request GET \
  --url http://127.0.0.1:8081/v1/user
Get
curl --request GET \
  --url http://127.0.0.1:8081/v1/user/1
Create
curl --request POST \
  --url http://127.0.0.1:8081/v1/user \
  --header 'content-type: application/json' \
  --data '{
	"user": {
		"username": "admin",
		"state": 2
	}
}'
Update
curl --request PUT \
  --url http://127.0.0.1:8081/v1/user/1 \
  --header 'content-type: application/json' \
  --data '{
	"user": {
		"id": "1",
		"username": "admin",
		"state": 5
	}
}'
Delete
curl --request DELETE \
  --url http://127.0.0.1:8081/v1/user/1

Geração de certificados de segurança

openssl genrsa -out server.key
openssl req -new -sha256 -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -out server.crt -signkey server.key

Geração do JWT Secret

openssl rand -base64 64

Todo

  • status codes nos erros

  • Validação de contexto - timeout, interrupt...

  • Testes - client, server

  • JWT Manager

  • Interceptors

    • Server
      • unary
      • stream
    • Client
      • unary
      • stream
  • Camada client

Changelog

Referências

https://dev.to/plutov/docker-and-go-modules-3kkn

grpcurl -v -d '{}'
-plaintext localhost:3000 api.UserService.Get

Directories

Path Synopsis
cmd
cli
gw
pkg
Package proto is a reverse proxy.
Package proto is a reverse proxy.

Jump to

Keyboard shortcuts

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