Skip to content

An attempt to learn Go by using the draft version of API template

Notifications You must be signed in to change notification settings

KoSKuma/go-worker-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO-API-TEMPLATE

Install dependency

$ make install
  • install depencency
  • install air
  • install mockery

How to dev

$ make dev

Swagger

Generate swagger.json

$ make doc

Declarative comments format

https://github.com/swaggo/swag#declarative-comments-format

Project Structure

├── cmd                                #Contains main applications for this project. e.g. API application, Worker application.
│   ├── api                            #Contains things only depend on application e.g. API application should have handlers, middleware, routes, etc.
│   ├── worker
├── config                             #Load and validate config from environment variables to use as a dependency.
│   ├── config.go
│   └── config.yml
├── docker                             #Contains Dockerfile, docker-compose.yml for development purpose
│   ├── Dockerfile
│   └── docker-compose.yml
├── pkg
│   ├── adapters                       #Contains the inbound/outbound adapters e.g. database connection, message queue connection.
│   ├── constant                       #Contains constant variables e.g. context fields, custom HTTP header fields.
│   ├── entity                         #Contains the entities.
│   ├── repository                     #Contains the database repositories.
│   ├── service                        #Contains the services for external communication e.g. sending API requests, sending messages through a message queue.
│   ├── usecase                        #Contains the use cases.
│   ├── log                            
│   └── validator

About

An attempt to learn Go by using the draft version of API template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages