Giter Site home page Giter Site logo

mrtuuro / toll-calculator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.03 MB

A microservice project that calculates both distance and invoice written in Golang. Both includes gRPC and HTTP transport layers.

License: MIT License

Makefile 1.21% Go 98.79%

toll-calculator's Introduction

toll-calculator

docker run --name kafka -p 9092:9092 -e ALLOW_PLAINTEXT_LISTENER=yes -e KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true bitnami/kafka:latest 

Installing protobuf compiler (protoc compiler)

For linux users or (WSL2)

sudo apt install -y protobuf-compiler

For Mac users you can use Brew for this

brew install protobuff

Installing GRPC and Protobuffer plugins for Golang.

1. Protobuffers

go install google.golang.org/protobuf/cmd/[email protected]

2. GRPC

go install google.golang.org/grpc/cmd/[email protected]

3. NOTE that you need to set the /go/bin directory in your path. Just like this or whatever your go directly lives.

PATH="${PATH}:${HOME}/go/bin"

4. install the package dependencies

4.1 protobuffer package

go get google.golang.org/protobuf

4.2 grpc package

go get google.golang.org/grpc/

Installing Prometheus

Install Prometheus in a Docker container

docker run -p 9090:9090 -v ./.config/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus

Installing prometheus golang client

go get github.com/prometheus/client_golang/prometheus

Installing Prometheus natively on your system

  1. Clone the repository
git clone https://github.com/prometheus/prometheus.git
  1. Install
cd prometheus
make build
  1. Run the Prometheus deamon
./prometheus --config.file=<your_config_file>yml
  1. In the projects case that would be (running from inside the project directory)
../prometheus/prometheus --config.file=.config/prometheus.yml
brew install protobuf

Installing gRPC and Protobuffer plugins for Golang.

1. Protobuffers

go install google.golang.org/protobuf/cmd/[email protected]

2. gRPC

go install google.golang.org/grpc/cmd/[email protected]

3. NOTE that you need to set the /go/bin directory in your path

PATH="${PATH}:${HOME}/go/bin"

4. Install the package dependencies

4.1 protobuffer package

go get google.golang.org/protobuf

4.2 grpc package

go get google.golang.org/grpc

5. Run Prometheus With Docker

docker run --name prometheus -d -p 127.0.0.1:9090:9090 prom/prometheus

toll-calculator's People

Contributors

mrtuuro avatar

Watchers

 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.