/logapi

Primary LanguageGo

LogApi

Logapi is a tool to run alongside your containers that will allow you to interpret logs and serve them as a rest api

Usage

All the command are available in the Makefile but the easiest way is to docker-compose up web and curl 127.0.0.1:8080/files you can also try tilt up to test the application directly on kubernetes All commands will use the example log file Β΄examples/log.txt'

Test

'go test pkg/...'

Architecture

πŸ“¦ cmd
β”‚ πŸ“œ *.go # cli definition
πŸ“¦ pkg
β””β”€β”€β”€πŸ“‚ conf # Configuration management and stop signal handling
β””β”€β”€β”€πŸ“‚ file # The file pagckage that handles log parsing and http translation
β””β”€β”€β”€πŸ“‚ server # Handles the http server bolierplate
β””β”€β”€β”€πŸ“‚ store # Defines the storage
πŸ“¦ kustomize # Kubernetes manifests
πŸ“œ config.yaml # The default config for the app
πŸ“œ logapi.go # common interfaces
πŸ“œ Dockerfile # The application image definition
πŸ“œ Tiltfile # tilt is a tool that allows you to run your code with live reload on your local k8s cluster
πŸ“œ docker-compose.yaml # To make docker commands easier
πŸ“œ Makefile # Colletion of usefull commands

TODO (Things that are kinda of outside scope)

  • Handle file update (Maybe watch the file)
  • Read only parts of the file that were not read (Maybe index the reads)
  • handle multiple files (Maybe use the file name as index)
  • Maybe Create A view layer for store
  • Handle more test cases