github.com/axelgeorg/ImersaoGo_03022023

APIs e Mensageria Kafka com Golang


Install
go get github.com/axelgeorg/ImersaoGo_03022023

Documentation

Terminal 1:
    docker-compose up -d

    docker-compose exec mysql bash
     mysql -uroot -p products
     Enter password: root
      create table products (id varchar(255), name varchar(255), price float);

Terminal 2:
    docker-compose exec kafka bash
     kafka-topics --bootstrap-server=localhost:9092 --topic=product --create

Terminal 3:
    docker-compose exec goapp bash
     go run cmd/app/main.go 


Para teste no Postmain:

Post - http://localhost:8000/products
{
    "name": "My Product 3",
    "price": 103
}

Retorno:
{
    "ID": "09938983-c496-479e-a50c-c8853483998a",
    "Name": "My Product 3",
    "Price": 103
}