smmd / Go-Dispatch-Bootcamp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go-Dispatch-Bootcamp

This API is an exercises that should contain:

  • An endpoint for reading from an external API
    • Write the information in a CSV file
  • An endpoint for reading the CSV
    • Display the information as a JSON
  • An endpoint for reading the CSV concurrently with some criteria (details below)
  • Unit testing for the principal logic
  • Follow conventions, best practices
  • Clean architecture
  • Go routines usage
  • Authentication token to use as header in all endpoints

External API used: Pokemon

Usage examples for this API.

Running server:

go run main.go

To access API endpoint's is needed generate a token.

curl http://localhost:3001/generate-token/

GET All Poke monsters:

curl http://localhost:3001/pokemonsters/

GET Poke monster by ID:

curl http://localhost:3001/pokemonsters/{id}

Consume external api and populate CSV:

http://localhost:3001/fill-pokedex/

GET Poke monsters with worker pool:

http://localhost:3001/:type/:items/:items_per_workers

type: "odd" or "even", items: amount of valid items response, items_per_workers: amount of valid items per worker

How to run Unit test suite.

go test ./...

Documentation

Must to learn

Self-Study Material

About


Languages

Language:Go 100.0%