Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

gitlab.com/dctx/contact-tracer/devcon-contact-tracer.git/location-service

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlab.com/dctx/contact-tracer/devcon-contact-tracer.git/location-service


Version published
Created
Source

location-service

The location service handles all location related transaction such as checkin, etc.

Getting Started

To clone the repo:

git clone git@gitlab.com/dctx/contact-tracer/devcon-contact-tracer.git
cd location-service

A docker image is also avaible in Docker Hub:

docker pull dctx/location-service:latest

Prerequisire

Workspace

  • Go
  • Docker

Docker images

  • Kafka (bitnami/kafka:2.4.1)

Deployment

  • Docker Compose
  • Kubernetes (minikube)
  • Helm

Build

Run the following to build the binary:

make build

The binary will be located in: build/bin/location-service

Configuration

Configuration is handled by viper which allows configuration using a config file or by environment variables.

A sample configuration file can be found in config/.location-service.yaml. Copy this to the $HOME directory to override the defaults.

Setting environment variables can also override the default configuration:

Environment VariableDescriptionDefault
LOCATION_SERVICE_SERVER_HOSTName of the host or interface to bind the server0.0.0.0
LOCATION_SERVICE_SERVER_PORTPort to bind the server8080
LOCATION_SERVICE_KAFKA_BROKERSAddresses of the Kafka Brokersbroker1:9092,broker2:9092
LOCATION_SERVICE_KAFKA_TOPICThe topic to publish/subscribe todctx-commands
LOCATION_SERVICE_KAFKA_PARTITIONThe topic partition0
LOCATION_SERVICE_KAFKA_MINBYTESMin Bytes when reading messages10000
LOCATION_SERVICE_KAFKA_MAXBYTESMax Bytes when reading messages10000000

Starting the Service

make run

Packaging Image

To create the docker image:

make package

To publish the image to docker hub:

make publish

Note that publishing the image requires access to the dctx group in docker hub.

Development

This project follows gitlab flow. The general flow is:

  • Pick / Create an issue
  • Create a feature branch
  • Open a Merge Request
  • Maintainer merge's to master

Read more about gitlab flow here.

Project Structure

location-service
|- build/               # build artifacts are generated here
|- cmd/                 # command line commands live here. Checkout cobra library
|- config/              # configuration files are here
|- helm/                # helm chart for kubernetes deployment
|- internal/            # for internal go packages 
| |- server
| |- ...
|- pkg/                 # for public go packages
|- .dockerignore        # ignore list for docker
|- .gitignore           # ignore list for git
|- go.mod               # dependencies for project
|- go.sum               # checksum for dependencies, do not manually change
|- main.go              # the main go file
|- Makefile             # build scripts
|- README.md            # this file

Adding Dependencies

To add dependencies, run the following:

go get -u {dependency}
make deps

TODO

Initial ToDo list:

  • Improve this README
  • Setup Gitlab CI/CD
  • Create kafka connector
  • Define features in Gitlab Issues or Trello

FAQs

Package last updated on 23 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc