Skip to content

bestmods/tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tasks

Program made in Go to handle Best Mod's tasks via sending HTTP requests to a REST API.

Command Line

The following command line options are available from the help menu.

./tasks --cfg <cfgFile> --list --version --help
        --cfg => Path to config file. Default path is /etc/bestmods-tasks/tasks.conf.
        --list => Lists configuration file.
        --version => Prints the current version.
        --help => Prints the help menu.

Configuration File

The configuration file is parsed using JSON. Here is a config example.

{
    "debug": 2,
    "tasks": [
        {
            "cronstr": "* * * * * *",
            "url": "mydomain.com",
            "auth": "Bearer TEST",
            "method": "GET"
        }
    ]
}
  • debug - Debug level from 0 - 3.
  • tasks - An array of tasks to schedule via Cron.
    • cronstr - The cron string to schedule (read more here).
    • url - URL to send our HTTP/HTTPS request to.
    • auth - What to set the Authorization header to within the request.
    • method - HTTP method (e.g. GET, POST, etc.).

Building

Building is simple via git and go build.

# Clone repository.
git clone https://github.com/bestmods/tasks

# Change directory.
cd tasks

# Build to `./tasks`.
go build -o tasks

Credits

About

Go program that uses Cron-like tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages