项目作者: bahattincinic

项目描述 :
Build Simple Messenger API with Golang
高级语言: Go
项目地址: git://github.com/bahattincinic/messenger-challenge.git
创建时间: 2020-04-28T12:23:22Z
项目社区:https://github.com/bahattincinic/messenger-challenge

开源协议:MIT License

下载


Messenger Challenge

I developed a simple Messenger API with golang to make a practice.

Requirements

Folder Structure

  1. .
  2. ├── README.md
  3. ├── api # HTTP API is under this folder
  4. ├── handlers # API controller/handlers
  5. ├── middlewares # API middlewares
  6. └── routes.go # All Api Routes
  7. ├── config # Project Configurations
  8. ├── config.go
  9. ├── development.yaml
  10. └── production.yaml
  11. ├── domain # All business logic related things are under this folder.
  12. ├── models # Database and data models
  13. ├── repositories # Database query layer
  14. └── usecases # business usecases
  15. ├── go.mod
  16. ├── go.sum
  17. ├── main.go
  18. └── messenger.db

Installation

  1. $ git clone git@github.com:bahattincinic/messenger-challenge.git
  2. $ cd messenger-challenge
  3. $ go mod download

Running Unit Tests

  1. $ go test ./... -coverprofile cp.out
  2. ? github.com/bahattincinic/messenger-challenge [no test files]
  3. ? github.com/bahattincinic/messenger-challenge/api [no test files]
  4. ? github.com/bahattincinic/messenger-challenge/api/handlers [no test files]
  5. ok github.com/bahattincinic/messenger-challenge/api/middlewares 0.284s coverage: 17.6% of statements
  6. ok github.com/bahattincinic/messenger-challenge/config 0.299s coverage: 90.0% of statements
  7. ? github.com/bahattincinic/messenger-challenge/domain/models [no test files]
  8. ok github.com/bahattincinic/messenger-challenge/domain/repositories 0.373s coverage: 63.0% of statements
  9. ok github.com/bahattincinic/messenger-challenge/domain/usecases 0.564s coverage: 73.1% of statements

API Documentation

Postman Documentation: https://documenter.getpostman.com/view/191558/SzmcZe7s?version=latest

Github Actions

I added 2 different Github Actions Job for automating unit-test and linter process.

https://github.com/bahattincinic/messenger-challenge/actions