Giter Club home page Giter Club logo

calculator's Introduction

calculator

This is a simple calculator to demonstrate the use of the following tools:

  • Golang
  • Protocol Buffers
  • gRPC
  • Go modules

What it does

The calculator server implements a method Calculate add, substract, multiply or divide two numbers.

System requirements

To get information about system requirements, please visit the Golang MinimumRequirements Wiki Page

Installation

To install Golang, please follow the instructions on the Golang Getting Started Page

As the server implements a generated Protocol Buffer file, this file needs to be generated first.
Therfor please download the protocol buffer compiler protoc with the gRPC go plugin:

$ go get -u github.com/golang/protobuf/protoc-gen-go

After you installed the compiler you can generate the go-code file from the Protocol Buffer:

$ protoc -I calculator/ calculator/calculator.proto --go_out=plugins=grpc:calculator

As this project supports Go modules, it is not necessary anymore to "go get" all dependencies.
You can run the program either by running the two .go files for server and client:

  1. $ go run server/calculator_server.go (first time Go modules are allocated)
  2. $ go run client/calculator_client.go <number><operator><number>

Or you build executable files by running:

  1. $ go build server/calculator_server.go
  2. $ go build client/calculator_client.go

Afterwards you can run the client like:
./calculator_client <number><operator><number> on Unix
or
calculator_client.exe <number><operator><number> on Windows

More information

For more information about gRPC please visit:

gRPC.io

For more information about Protocol Buffers please visit:

Protocol Buffers - Google Developers Guide

calculator's People

Contributors

knudsentaunus avatar

Stargazers

Toan Tran avatar Alex Nnakwue avatar

Watchers

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