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
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
go test ./...
- Go Tour
- Go basics
- Git
- Tool to practice Git online
- Effective Go
- How to write code
- Go by example
- Go cheatsheet
- Any talk by Rob Pike
- The Go Playground
- Golang Docs
- Constants
- Variables
- Types
- For Loops
- Conditional statements: If
- Multiple options conditional: Switch
- Arrays and Slices
- Clean Architecture
- Maps
- Functions
- Error Handling
- Structures
- Structs and Functions
- Pointers
- Methods
- Interfaces
- Interfaces
- Packages
- Failed requests handling
- Modules
- Unit testing
- Go tools
- More Go tools
- Functions as values
- Concurrency (goroutines, channels, workers)