events

command module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

events

Build Status codecov Go Report Card License Tag

Introduction

events is the Gerrit events written in Go.

Prerequisites

  • Go >= 1.18.0

Run

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

Docker

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

Usage

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

gerrit events

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

events parameters can be set in the directory config.

An example of configuration in config.yml:

apiVersion: v1
kind: events
metadata:
  name: events
spec:
  connect:
    hostname: localhost
    ssh:
      keyfile: /path/to/.ssh/id_rsa
      keyfilePassword: pass
      port: 29418
      username: user
  storage:
    autoclean: "@every 48h00m00s"
    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-Type: application/json;charset=UTF-8
[
  {
    "eventBase64": "ZXZlbnRCYXNlNjQ=",
    "eventCreatedOn": 1672214667
  },
  ...
]
  • Parameters
since:'TIME': Events since the 'TIME', in the format 2023-01-01[ 10:00:00].
until:'TIME': Events until the 'TIME', in the format 2023-01-01[ 11:00:00].
  • Examples
# 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:2023-01-01+10:00:00+until:2023-01-01+11:00:00”

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