tasker

package module
v0.0.0-...-f6c6bc8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 10 Imported by: 0

README

Actions Status Actions Status

Tasker - [ DEVELOPMENT IN PROGRESS ]

Tasker is a job scheduling service that utilizes go-cron. Tasker is a service that will allow for dynamic configration of tasks.

Tasker is inspired by the Android application tasker the ability to set scripts and schedule them at whim without needing to touch the server code.

Installation

Import tasker:

    import "github.com/roger-king/tasker"

Install via Go Modules:

    go mod vendor

Getting Started:

Tasker is simple to get started. Tasker has 2 goals at mind:

  • Create a schedule for task to run external scripts
  • Create your own handler functions to programmatically run code
    t := tasker.New()
	router := t.Start()

    // Add to your HTTP Server
	http.Handle("/", router)
	http.ListenAndServe(":8080", nil)

Go to your server and find the tasker web client at /tasker/admin.

Configuration of your server

Tasker utilizes 12 Factor App configs. Tasker relies environment variables to handle configruation of the application

Below are the availble of environment variables that Tasker looks for (note: prefixed with TASKER_):

ENV Description
TASKER_DB_MIGRATE true/false flag for auto migrate on start up
TASKER_DB_CONNECTION_URL Postgres connection uri
GITHUB_CLIENT_ID Github Client ID for authentication
GITHUB_CLIENT_SECRET Github Secret for authentication

Connection to the database can be set by either setting TASKER_DB_CONNECTION_URL or by setting

TODOS:

View the Github Projects board: https://github.com/roger-king/tasker/projects/1

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ProvideConfig

func ProvideConfig() *models.TaskerConfig

func ProvideCron

func ProvideCron() *cron.Cron

Types

type Tasker

type Tasker struct {
	Config    *models.TaskerConfig
	DB        *mongo.Client
	Scheduler *cron.Cron
	Router    *mux.Router
}

Tasker -

func New

func New() (*Tasker, error)

func ProivdeTasker

func ProivdeTasker(tc *models.TaskerConfig, r *mux.Router, c *cron.Cron) *Tasker

func (*Tasker) Start

func (t *Tasker) Start() *mux.Router

Start - returns a mux router instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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