Skip to content

codegenic-dev/go-course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-course

This is a hands-on async course/workshop for learning how to build APIs with Go.

How to participate in this course:

  1. Fork this github repository.
  2. Start implementing the services step by step.

1. Todo API

We are going to implement an API that manages TODOs.
Think of it as the backend for something like this: https://reactjsexample.com/github-lilia-obushenko-todo-react-app/

// example
type MyRepo interface {
	Create(todo model.Todo) error
	Get(name string) (model.Todo, error)
}

type InMemRepo struct {
	...
}
  • Unit test your repo layer. https://go.dev/doc/tutorial/add-a-test

  • Implement service layer. Service layer has access to repo/ methods (via the interface) to perform at least the following operation Get Or Create.

  • Unit test your service layer.

  • Unit test your API layer. Yes, now that you have experience writing unit tests, first write the tests then write the code, TDD!.

  • Implement api layer. API layer does not has access to any other package (service interface is defined under API layer). https://gobyexample.com/http-servers

  • Initialize everything under cmd/todoapi/ and start the http API.

Ask help/questions in telegram @eoozs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages