Git Product home page Git Product logo

piflab-store-products-service-go's Introduction

PIFLab Store API

CircleCI
Coverage Status

API Docs

http://docs.piflabstore.apiary.io/

Dependencies

  • GO 1.5

3rd parties

Framework

Build Docker image

docker build -t piflab-store-api-go .

Run a command inside container

docker run -v `pwd`:/go/src/github.com/o0khoiclub0o/piflab-store-api-go piflab-store-api-go <command you want to run>

Add package

  • docker run -it -v `pwd`:/go/src/github.com/o0khoiclub0o/piflab-store-api-go piflab-store-api-go bash
  • go get <package>
  • import "<package>"
  • godep save ./...

Development

docker run -p 80:80 -v `pwd`:/go/src/github.com/o0khoiclub0o/piflab-store-api-go --env-file=.env --rm -it piflab-store-api-go bash

docker run -p 80:80 -v `pwd`:/go/src/github.com/o0khoiclub0o/piflab-store-api-go --env-file=.env --rm piflab-store-api-go gin -p 80 run

Testing

docker run -v `pwd`:/go/src/github.com/o0khoiclub0o/piflab-store-api-go piflab-store-api-go ginkgo -r

Migration

Migrate

goose up

Rollback

goose down

Seed

go run db/seeds/main.go

Docker-compose

Run entire app

docker-compose up

Manually start database

docker-compose up -d db

Manually run piflab-store-api command

docker-compose run -p 80:80 api <command you want to run>

Practical Docker-compose use

  • cd to root of project directory
  • Start DB docker-compose up -d db
  • Start API docker-compose run -p 80:80 api bash
  • Start bash instance of DB sudo docker exec -it <container_id> bash

Golang dump

import "github.com/davecgh/go-spew/spew"
spew.Dump(structure_to_be_dump)

Save package

If use godep save . it will remove the pacakges that aren't used in source code (such as ginkgo, gomega, ...), so use godep save ./... save only (no remove).

piflab-store-products-service-go's People

Contributors

zealotnt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.