Skip to content

Simple Web Service to register events into logs

Notifications You must be signed in to change notification settings

betorvs/event-logger

Repository files navigation

event-logger

Go Test Coverage Status

This is a simple event to log web service to register any kind of events like deployments, alerts, code analysis and whatever you believe that needs to be registered.

Environment variables

export PORT=9090

export APP_NAME=event-logger

export LOG_LEVEL=INFO

export USEPROMETHEUS=true

TIP: Export USEPROMETHEUS=true to enable /metrics endpoint.

Dependency Management

The project is using Go Modules for dependency management Module: github.com/betorvs/event-logger

Test and coverage

Run the tests

TESTRUN=true go test ./... -coverprofile=cover.out

go tool cover -html=cover.out

Install golangci-lint and run lint:

golangci-lint run

Docker Build

docker build .

Send one test

#!/usr/bin/env bash

curl -v -X POST -H "Content-Type: application/json" -d '{
    "name": "test1",
    "kind": "test",
    "labels": {
        "testa": "testa1"
    },
    "message": "test1 event logging",
    "source": "curl command",
    "status": 2
}' \
  http://localhost:9090/event-logger/v1/event

References

Golang Spell

The project was initialized using Golang Spell.

Architectural Model

The Architectural Model adopted to structure the application is based on The Clean Architecture. Further details can be found here: The Clean Architecture and in the Clean Architecture Book.

About

Simple Web Service to register events into logs

Resources

Stars

Watchers

Forks

Packages

No packages published