Skip to content

toanppp/go-clean-tx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-clean-tx

Go Clean Architecture with transaction

Todo

  • Clean architecture
  • Clean transaction

Run

go generate ./...
go test ./...
go run ./cmd/http

Architecture

Clean Architecture

Source: MyTaskPanel Consulting

Structure

A typical top-level directory layout

.
├── cmd                     # Main applications
├── internal                # Private application and library code
├── pkg                     # Library code that's ok to use by external applications
├── go.mod
├── go.sum
├── LICENSE
└── README.md

Private application and library code

.
├── ...
├── internal
│   ├── domain              # Domain: entity, data model
│   ├── port                # Port: interface for communicating between layers
│   │   └── mock
│   ├── infrastructure      # External elements with which the application communicates, both input and output
│   │   ├── http            # Entry point: an API with REST or GraphQL, messaging with RabbitMQ or via CLI, etc.
│   │   │   ├── gin
│   │   │   └── presenter
│   │   └── repo            # Exit point: a database with PostgreSQL, MongoDB, or sending messages with RabbitMQ, etc.
│   │       ├── memory
│   │       └── database
│   └── usecase             # Business logic happens here
└── ...

References

About

Go Clean Architecture with transaction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages