Giter VIP home page Giter VIP logo

realize_sample's Introduction

概要

go + realize + grpc-gateway をDocker上で動かしホットリロードを行うためのサンプルです。

確認方法

1. ファイルの設置

ここのファイル一式を以下に設置

$GOPATH/src/github.com/gosagawa/realize_sample

2. hostsの設定

local.realize_sample.netをhostsファイル(MacOSなら/etc/hosts)に登録する

127.0.0.1 local.realize_sample.net

3. ライブラリ取得

make bundle

4. コンテナ起動

docker-compose up

5. 動作確認

まず、以下が表示できる事を確認。

$curl http://local.realize_sample.net/user/1
{"id":1,"name":"John","age":18}

その後adapter/grpc/user.goを書き換えて保存後、APIの値が変われば成功です(自動でビルドされて、反映されます)。

curl http://local.realize_sample.net/user/1
{"id":1,"name":"John","age":18}

adapter/grpc/protoDifinition以下にproto定義を持っています。 protoは保存しても即時反映されず、protoのmakeした後に反映されます。

make proto

解説記事

このサンプルをGopher道場advent calendar 2018 12/13公開の記事で解説します。公開後にリンクします。

realize_sample's People

Contributors

gosagawa avatar

Stargazers

Hirokazu Maruta avatar

Watchers

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