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: ? 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

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
⌂ 换网址