Golang APIs for Example service.
this project contains backend APIs and logic for Example Service powered by Go,Gin,Redis,MinIO,CouchBase and Dgraph
Application runs on Go 1.14 And redis,couchbase,MinIO,dgraph and scylladb.
- [Project Structure](#Project Structure)
- [Install application](#Install application)
- Configuration
- Features
- [Services and Database dependencies](#Services and Database dependencies)
- Testing
.
├── config # all config files is here
├── file # develop yml config file is here
└── test_conf # unit test yml config file is here
├── console # console commands dicretory
└── cmd # all console commands is here
├── constants # some static values is here
├── docs # any documentation is here swagger,flowchat,gif , ....
├── logic # business logic layer directories. all server business logics is here
└── tests # we create logics unit test in here
├── model # we save project struct/models in here
└── proto # also if we need proto files we save it here
├── repository # repository layer directories. all server repository logics is here
├── rediskeys # redis keys names is here
├── couchbaseQuery # we save static quere is here
└── tests # we create repository unit test in here.
├── router # router layer directories. all server router logics is here
├── grpc # a directory for grpc routers
└── http # a directory for http routers
└── tests # we create controllers unit test in here.
├── services # request and connections to therd party servers is here
├── utils # some local utils functions saved in here
├── .gitignore # realy this need explain ?!?!?
├── .gitlab-ci.yml # gitlab ci stages and commands
├── go.mod # go modules file
├── go.sum # go modules file
├── main.go # project started in this file
└── Readme.md # you read me here :)
https://github.com/RezaOptic/gin-project-structure
cd gin-project-structure
To installation dependencies use go mod vendor
command.
by default app server in running read config file from ./file/cofigs.yml
if you want to change some service or database address or ports must edit config file
to setup config you can set your settings into yml file.
To run application on development config use
go run main.go
some time we need some worker to do some jobs periodically we use cobra
to write console commands to do some jobs.
we have multiple grpc methods :
we have multiple http route :
/v1/
POST
: api for .../v1/
POST
: api for .../v1/
POST
: api for ...
this server need redis
,couchbase
,MinIO
, dgraph
and scylladb
servers to start running.
- TODO: Add dependency injection structure
- TODO: Additional instructions for testing the application.
- TODO: maybe better configs structure