status-cron

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

status-cron

Service to build a Status Page

Run a cron with this binary for every minute to build data points

Download latest version (linux/amd64)

Services supported

  • HTTP
  • Redis
  • SQL
    • Postgres
    • MySQL
    • Oracle
  • MongoDB

Configuration

Config THIS Job

Services can be fetched from the following modes and can be specified using the env DB_TYPE

  • Postgres DB: postgres
    • ENV REQUIRED: POSTGRES_URI=postgres://localhost:5432/postgres
    • See sample.sql to create tables
  • JSON File: json
    • ENV REQUIRED: JSON_PATH="/home/ec2-user/status-cron/config.json"
    • See sample.json for configuration

See sample.env

Service Configuration

Base Config (Common among all):

{
    id: int (should be unique),
    name: string,
    url: string (taken as base for connection),
    type: [http | redis | sql | mongo],
    cron: string (determines whether to run or not),
    data: Object (service specific data)
}
HTTP Services
data: {
    method: string (Request method),
    headers: map[string]string (Headers to be added),
    status: int (status to expect)
}

Response checks are only done for status

Redis Service
data: {
    password: string (taken from url if empty),
    timeout: int (Timeout for connection),
}
SQL Service
data: {
    driver: string (driver type [postgres | mysql | oracle]),
    timeout: int (Timeout for connection),
}
Mongo Service
data: {
    timeout: int (Timeout for connection),
}

Response format

service_id: int
success: bool
reason: string (reason if failed)
cron_time: time (result cron time)

MISC

Debug Options
PRINT_RESULT=<bool> (Print the results of the services requests to console)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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