go-blog

command module
v0.0.0-...-dff89a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2019 License: MIT Imports: 13 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL