gum
github.com/douglaszuqueto/go-user-microservice
go get github.com/douglaszuqueto/go-user-microservice
gum

github.com/douglaszuqueto/go-user-microservice

Microservice de usuário utilizando Go, GRPC e PostgreSQL

by Douglas Zuqueto

v0.0.0-20200713005320-6bccb8e8c74c (see all)License:MIT
go get github.com/douglaszuqueto/go-user-microservice
Readme

Serviço de usuário utilizando Go e GRPC

Serviços

  • Server
  • Gateway
  • CLI

Requisitos

Storage

  • Memória
  • PostgreSQL

Métodos

  • list
  • get
  • create
  • update
  • delete

Deploy

Standalone

Docker

Docker compose

Kubernetes

API

  • Endpoints
VersionHTTPPath
/v1GET/user
/v1GET/user/1
/v1POST/user
/v1PUT/user/1
/v1DELETE/user/1

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...
  • JWT Manager
  • Interceptors
    • Server
      • unary
      • stream
    • Client
      • unary
      • stream
  • CLI
  • Testes - client, server

Changelog

Referências

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

GitHub Stars

12

LAST COMMIT

2yrs ago

MAINTAINERS

0

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20200713005320-6bccb8e8c74c
2yrs ago
v0.0.0-20200620004759-6ea51fc47bbf
2yrs ago
v0.0.0-20200619001209-0f5b2bd6e0d9
2yrs ago
No alternatives found
No tutorials found
Add a tutorial