Skip to content

evt/immulogapi

Repository files navigation

Go Report Repository Top Language GitHub go.mod Go version Github Repository Size Github Open Issues Lines of code License GitHub last commit GitHub contributors

ImmuDB log API

Task description

The goal is to write a simple REST or GRPC service in Golang that uses immudb as a database to store lines of logs. Service and immudb should be easily deployable using docker, docker-compose or similar. There should be another simple testing tool that allows you to easily create log entries.

The service should allow to:

  • Store single log line
  • Store batch of log lines
  • Print history of stored logs (all, last x)
  • Print number of stored logs
  • (optional) Simple authentication mechanism to restrict read/write access.
  • (optional) Support for log buckets, so logs from different applications can be separated i.e. depending on source or some token used.

Solution notes

  • 🔱 clean architecture (handler->service->repository)
  • 📖 standard Go project layout (well, more or less 😊)
  • 🔄 gRPC + gateway for REST API
  • 🐳 dockerized + docker-composed
  • 🐘 ImmuDB in a standard SQL mode used (easy to replace with any other SQL DB)

HOWTO

  • Run in docker-compose with make dc. This will start logapi and immudb containers, create users and loglines tables and a test user test with password test.
  • Run Postman collection from ./postman to test the API.

TODO

  • unit tests
  • testing tool

Releases

No releases published

Packages

No packages published