Skip to content

deepinbytes/go-blog

Repository files navigation

Go Blog

Build Status Coverage Status Go Report

Packages used

Usage

Run ./start.sh or manually enter the docker compose commands to bring up local server and postgresql db instance.

$ docker-compose build
$ docker-compose down
$ docker-compose up -d
$ docker-compose exec go-blog psql -U admin -d go_blog -a -f /docker-entrypoint-initdb.d/db.sql

The application runs as an HTTP server at port 8080. It provides the following RESTful endpoints:

  • GET /ping: a ping service mainly provided for health check purpose
  • GET /v1/articles: returns a paginated list of the article
  • GET /v1/articles/:id: returns the detailed information of an article
  • POST /v1/articles: creates a new article
  • PUT /v1/articles/:id: updates an existing article
  • DELETE /v1/articles/:id: deletes an article
  • POST /v1/auth: authenticate a user

Project Structure

  • models: contains the data structures used for communication between different layers.
  • services: contains the main business logic of the application.
  • daos: contains the DAO (Data Access Object) layer that interacts with persistent storage.
  • apis: contains the API layer that wires up the HTTP routes with the corresponding service APIs.

The rest of the packages are used globally:

  • app: contains routing middlewares and application-level configurations
  • errors: contains error representation and handling
  • util: contains utility code

About

Blogger API written on Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors