Git Product home page Git Product logo

go_json's Introduction

Golang

Serials

Basic Info

download tarball
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
export go path in /etc/profile

Closure

Share

Http

Best Practice

Reflect

Interface

Database

Cache

Microservice

Third-Party Libraries

Web Server Framework: beego

Web Server Framework: gin

Docker Image

gin Development

  • use <codegangsta/gin> to do golang web application live reloading with docker
  • docker file
# Version: 1.0.0
# Create Time: 2018-07-20
# Author: Jason Tu
# Description: Microservice Audit log img

FROM golang:latest

# Install golang library
RUN go get github.com/gin-gonic/gin && go get github.com/go-sql-driver/mysql \
    && go get github.com/codegangsta/gin

# Expose the application on port 8080
EXPOSE 8080

# Set the entry point of the container to the bee command that runs the
# application and watches for changes
CMD ["gin", "run", "*.go"]
# or CMD ["/bin/bash"]
  • commands
docker run -i -d --rm --name auditlog_ms -p 8080:3000 -v /root/gin_playground/auditlog_ms:/go/src/auditlog_ms -w /go/src/auditlog_ms auditlog_ms:base
or
docker run -it --rm --name auditlog_ms -p 8080:3000 -v /root/gin_playground/auditlog_ms:/go/src/auditlog_ms -w /go/src/auditlog_ms auditlog_ms:base

gin Deploy

# Version: 1.0.0
# Create Time: 2018-07-20
# Author: Jason Tu
# Description: Microservice Audit log img

FROM golang:latest

# Create the directory where the application will reside
RUN mkdir /app

ADD auditlog_ms /app/auditlog_ms
ADD conf /app/conf

WORKDIR /app

EXPOSE 8080

# Set the entry point of the container to the application executable
ENTRYPOINT /app/auditlog_ms
  • commands
docker run -i -d --rm --name auditlog_ms_prod -p 8081:3001 auditlog_ms:prod

Dependency Management

go get -u github.com/kardianos/govendor
# then build govendor

# goto src code folder
govendor init
govendor add +external
# commit the library code

go_json's People

Contributors

jasontu avatar

Watchers

James Cloos avatar  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.