https://github.com/mahdi-asadzadeh/go-kit-accounts
https://github.com/mahdi-asadzadeh/go-kit-accounts
clean-architecture clean-code docker docker-compose go go-example go-kit golang golang-example microservice
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/mahdi-asadzadeh/go-kit-accounts
- Owner: mahdi-asadzadeh
- Created: 2022-10-26T18:38:30.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-04T08:34:35.000Z (almost 3 years ago)
- Last Synced: 2025-03-05T14:03:17.192Z (7 months ago)
- Topics: clean-architecture, clean-code, docker, docker-compose, go, go-example, go-kit, golang, golang-example, microservice
- Language: Go
- Homepage:
- Size: 148 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About The Project
Example golang using GO-KIT framework everything you need :)## Installation(manually):
#### run server
go run cmd/main.go
#### run client
go run clients/main.go
#### Swagger APIhttp://localhost:8081/swagger/index.html/ [link](http://localhost:8081/swagger/index.html)
## Installation(docker):
#### Prerequisites
- docker
for download docker in [link](https://docs.docker.com/engine/install/)- docker-compose
for download docker in [link](https://docs.docker.com/compose/install/)
#### create volume$ docker volume create postgres_data
#### create network
$ docker network create main
#### run service
$ docker-compose up -d --build#### Swagger API
http://localhost:8081/swagger/index.html/ [link](http://localhost:8081/swagger/index.html/)
## Test proejct:
$ go test ./pkg/tests -v
## Architecture:
### Service
Services are where all of the business logic is implemented. In Go kit, services are typically modeled as interfaces, and implementations of those interfaces contain the business logic. Go kit services should strive to abide the Clean Architecture or the Hexagonal Architecture. That is, the business logic should not know of transport-domain concepts: your service shouldn’t know anything about HTTP headers, or gRPC error codes.
### Endpoint
An endpoint is like an action/handler on a controller; it’s where safety and antifragile logic lives. If you implement two transports (HTTP and gRPC), you might have two methods of sending requests to the same endpoint.
### Transport
The transport domain is bound to concrete transports like HTTP or gRPC. In a world where microservices may support one or more transports, this is very powerful; you can support a legacy HTTP API and a newer RPC service, all in a single microservice.