learning-go

Learn Go by building a REST API and a Command Line Interface (CLI)

Welcome to Learning Go

Learn Go by building a REST API and a Command Line Interface (CLI).

We will also cover:

Are you ready?

Introduction

  1. What are we going to build?
  2. Prepare the development environment
  3. Please do a Go tour
  4. What you will learn about Go (checklist)

Iteration 1 - library and API skeleton

  1. Start the project for the Library
  2. Add programming/uuid generator function the Library
  3. Start the project for the API
  4. Add programming/uuid generator function to the API
  5. Unit tests in the API using mocks

Iteration 2 - basic CI/CD

  1. GitHub actions running locally
  2. GitHub actions for the Library
  3. Running the API using a container
  4. GitHub actions for the API

Iteration 3 - consolidate concepts by adding more features

  1. Add programming/jwtdebugger to the library and API
  2. Add finance/currency-converter to the library
  3. Add finance/currency-converter to the API

Iteration 4 - deploying to kubernetes

  1. Create a local kubernetes cluster
  2. Create a Helm chart for the API
  3. Deploy the API using Flux

Iteration 5 - code improvements

  1. Change API file structure
  2. Improve API error handling
  3. Add structured logs to the API
  4. Make Gin use structured logs

Iteration 6 - authentication & authorization

  1. Configure Amazon Cognito as an OAuth2 server
  2. Add authentication to the API
  3. Add authorization to the API

Iteration 7 - implementing the CLI

  1. Start the project
  2. Introduction to Cobra
  3. CLI building blocks: configuration
  4. CLI building blocks: authentication
  5. CLI building blocks: IO streams & testing helpers
  6. Add the configure command to the CLI
  7. Add the programming/uuid command to the CLI
  8. CI/CD for the CLI
  9. Challenge: Add the programming/jwtdebugger command to the CLI
  10. Challenge: Add the finance/currency-converter command to the CLI

Iteration 8 - increasing test code coverage

  1. How to check the test coverage?
  2. Increase coverage in the Lib
  3. Increase coverage in the API
  4. Increase coverage in the CLI

Conclusion

  1. What's next?