goscheduler

package module
v0.0.0-...-93f19fe Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 10 Imported by: 0

README

goscheduler

Your preferred scheduling solution™

Requirements

  • PostgreSQL for storing schedules
  • Redis for receiving and storing jobs
  • Sidekiq, or compatible library, for executing jobs
  • Go for polling PostgreSQL and publishing jobs to Redis

Database

CREATE TABLE schedules (
  id uuid DEFAULT gen_random_uuid() NOT NULL,
  period integer NOT NULL,
  period_unit character varying NOT NULL,
  starting_from timestamp without time zone NOT NULL,
  ending_at timestamp without time zone NOT NULL,
  last_run_at timestamp without time zone,
  lock_version integer DEFAULT 0 NOT NULL,
  created_at timestamp without time zone NOT NULL,
  updated_at timestamp without time zone NOT NULL
);

Running

$ go get
$ PGUSER=scheduler PGPASSWORD= PGDATABASE=scheduler_development PGSSLMODE=disable go run main.go

TODO

  • Remove go-workers dependency

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, vars ...interface{})

Debug example:

Debug("timezone %s", timezone)

func Error

func Error(err error)

Error example:

Error("timezone %s", timezone)

func Fatal

func Fatal(err error)

Fatal example:

Fatal(errors.New("db timezone must be UTC"))

func Info

func Info(msg string, vars ...interface{})

Info example:

Info("timezone %s", timezone)

func Start

func Start()

Start ...

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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