eventslog

command module
v0.0.0-...-088bab9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

eventslog

Build Status codecov Go Report Card License Tag

Introduction

eventslog is the Gerrit events log written in Go.

Prerequisites

  • Go >= 1.18.0

Run

version=latest make build
./bin/eventslog --config-file="$PWD"/config/config.yml --listen-port=8080

Docker

version=latest make docker
docker run -v "$PWD"/config:/tmp ghcr.io/gerrittrigger/eventslog:latest --config-file=/tmp/config.yml --listen-port=8080

Usage

usage: eventslog --config-file=CONFIG-FILE [<flags>]

gerrit events log

Flags:
  --help                     Show context-sensitive help (also try --help-long
                             and --help-man).
  --version                  Show application version.
  --config-file=CONFIG-FILE  Config file (.yml)
  --listen-port=8080         Listen port
  --log-level="INFO"         Log level (DEBUG|INFO|WARN|ERROR)

Settings

eventslog parameters can be set in the directory config.

An example of configuration in config.yml:

apiVersion: v1
kind: eventslog
metadata:
  name: eventslog
spec:
  connect:
    hostname: localhost
    ssh:
      keyfile: /path/to/.ssh/id_rsa
      keyfilePassword: pass
      port: 29418
      username: user
  storage:
    sqlite:
      filename: /path/to/sqlite.db
  watchdog:
    periodSeconds: 20
    timeoutSeconds: 20
  • spec.connect.hostname: Gerrit host name (e.g., 12:34:56:78)
  • spec.watchdog.periodSeconds: Period in seconds (0: turn off)
  • spec.watchdog.timeoutSeconds: Timeout in seconds (0: turn off)

API

  • Request
GET /events/ HTTP/1.0
  • Response
HTTP/1.1 200 OK
Content-Disposition: attachment
Content-Type: application/json;charset=UTF-8
{
  "eventBase64": "ZXZlbnRCYXNlNjQ=",
  "eventCreatedOn": 1672214667,
  ...
}
...
  • Parameters
since:'TIME': Events after the give 'TIME', in the format 2023-01-01[ 12:34:56].
until:'TIME': Events before the give 'TIME', in the format 2023-01-01[ 12:34:56].
  • Examples
# Query events which happened between 2023-01-01 and 2023-02-01
curl http://host:port/events/?q=since:2023-01-01+until:2023-02-01
# Query events which happened between 2023-01-01 10:00:00 and 2023-01-01 11:00:00
curl “http://host:port/events/?q=since:%25222023-01-01+10:00:00%2522+until:%25222023-01-01+11:00:00%2522”

License

Project License can be found here.

Reference

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL