kimyag / libraryservice

A simple LibraryService to demonstrate how to use Bazel+Go+gRPC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A simple LibraryService to demonstrate how to use Bazel+Go+gRPC

A simple library service (server and client).

Pre-work

The following instructions are tested on Ubuntu 16.04 (LTS).

  1. Install Bazel

    Bazel is our build tool. It is written in Java. Install Java and then Bazel.

    $ sudo apt-get install bazel

    Complete instructions for intalling Bazel on Ubuntu.

  2. Install Git

    Git is our version control system. It is used by Bazel to download some of our external dependencies (like Protocol Buffers, gRPC, and Bazel's Go rules.

    $ sudo apt-get install git
  3. (Optional) Install Go

    Go is a programming language and is very good at writting large-scale distributed systems. Our service and client are written in Go.

    $ sudo apt-get install golang-go

    Compelte instructions for installing Go on Ubuntu

  4. (Optional) Install Gazelle

    Gazelle is a helper tool that automatically generates Bazel BUILD files for Go and makes your life easier.

    $ go get -u github.com/bazelbuild/bazel-gazelle/cmd/gazelle
  5. (Optional) Install Buildifier

    Bazel Buildtools are helpers tools for Bazel. Buildifier cleans up and formats Bazel build files.

    $ go get github.com/bazelbuild/buildifier/buildifier

Clone, Build, Test

$ git clone git@github.com:ghasemloo/libraryservice.git
$ cd libraryservice
$ bazel build ...
$ bazel test ...

Run the server and the clinet

In one terminal run the server:

$ bazel run server/server -- --logtostderr

In another terminal run the client to send requests to the server:

$ bazel run client/client -- --logtostderr

References

MacOS

macOS instructions are similar to the instructions above for Ubuntu but follow the installation instructions on each linked site for macOS.

About

A simple LibraryService to demonstrate how to use Bazel+Go+gRPC

License:Apache License 2.0


Languages

Language:Go 52.5%Language:Python 47.5%