mathserver

module
v0.0.0-...-14493fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2019 License: MIT

README

mathserver

This repo contains various implementations of a basic server built in go that can execute the following operations:

  • Divide
  • Max
  • Min
  • Multiply
  • Pow
  • Subtract
  • Sum

Purpose

The purpose of the various implementations provided in this repository is to give an example of how/when different implementation styles should be followed. The implementations compared are go-kit, standard gRPC, and standard HTTP. The goal is to simply compare coding style and readability. Performance and efficiency of execution will not be compared.

Comparison

The implementations are as follows:

Client Implementations:
  • Supports both gRPC and HTTP
    • gokit:
      • Total number of lines written: 103
      • gRPC is achieved via go-kit gRPC client
      • HTTP is achieved via go-kit HTTP client
    • grpc_and_http:
  • Supports gRPC only
Server Implementations:
  • Supports both gRPC and HTTP
    • gokit:
      • Total number of lines written: 1046
      • gRPC is achieved via go-kit gRPC transport layer
      • HTTP is achieved via go-kit HTTP transport layer
      • Logging is achieved via middleware wrapping business logic (go-kit service) layer
      • Prometheus instrumentation is achieved via middleware wrapping the business logic (go-kit service) layer
    • std:
      • Total number of lines written: 483
      • gRPC is achieved via standard gRPC library
      • HTTP is achieved via standard net/http library plus gorilla router
      • Logging is achieved via middleware wrapping business logic layer
      • Prometheus instrumentation is achieved via middleware wrapping business logic layer
  • Supports gRPC only
    • gokit
      • Total number of lines written: 791
      • gRPC is achieved via go-kit gRPC transport layer
      • Logging is achieved via middleware wrapping business logic (go-kit service) layer
      • Prometheus instrumentation is achieved via middleware wrapping the business logic (go-kit service) layer
    • grpcnative
    • std
      • Total number of lines written: 371
      • gRPC is achieved via standard gRPC library
      • Logging is achieved via middleware wrapping business logic layer
      • Prometheus instrumentation is achieved via middleware wrapping business logic layer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL