BrunoKrugel / ari-apps

Golang ARI bindings for Lineblocs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lineblocs ARI services

Alt text

Prerequisites

Minimum software required to run the service:

Clone repository

git clone https://github.com/Lineblocs/ari-apps.git

Structure of Code

  1. api includes api functions which are connected to internals-api
  2. grpc includes protobuf files
  3. mngrs includes managing files
  4. types includes basic model types files
  5. utils includes common utils functions

Compiling protobuf files for gRPC

This project uses gRPC for server side API and includes files that use protobuf.

To compile the protobuf files please use the following commands:

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
protoc --go_out=plugins=grpc:. *.proto
protoc --go-grpc_out=grpc lineblocs.proto

Testing

Unit test with builtin Testing package

cd types
go test -v

Debugging

Configure log channels

Debugging issues by tracking logs

There are 4 log channels including console, file, cloudwatch, logstash Set LOG_DESTINATIONS variable in .env file

ex: export LOG_DESTINATIONS=file,cloudwatch

Linting and pre-comit hook

Go lint

sudo snap install golangci-lint

Config .golangci.yaml file to add or remote lint options

pre-commit hook

sudo snap install pre-commit --classic

Config .pre-commit-config.yaml file to enable or disable pre-commit hook

Deploy

Deploy Steps

  1. Install Docker on the machines you want to use it;
  2. Set up a registry at Docker Hub;
  3. Initiate Docker build to create your Docker Image;
  4. Set up your ’Dockerized‘ machines;
  5. Deploy your built image or application.

Deploy Command

docker build -t ari-apps

About

Golang ARI bindings for Lineblocs


Languages

Language:Go 98.5%Language:Dockerfile 0.7%Language:Makefile 0.5%Language:Shell 0.3%