rc

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

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

Go to latest
Published: Dec 31, 2018 License: MIT Imports: 7 Imported by: 0

README

redis-cron

Implementation of Cron over Redis

Why?

Just for curiosity for making cron which hosted not on local machine

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client defines a trigger client struct with a redis client

func New

func New(options *ClientOptions) *Client

New provides init of the new trigger client

func (*Client) AddTrigger

func (c *Client) AddTrigger(t *Trigger) error

AddTrigger provides append inserting of the new trigger to the Redis SET. Its based on the key empty-slots-timestamp and namespace

func (*Client) RemoveTrigger

func (c *Client) RemoveTrigger(key string, t *Trigger) error

RemoveTrigger provides method for removing trigger key

func (*Client) Start

func (c *Client) Start()

Start provides starting of app

type ClientOptions

type ClientOptions struct {
	Options redis.Options
	Pattern string
}

ClientOptions defines a trigger options with redis options

type Trigger

type Trigger struct {
	DateTime  time.Time
	Namespace string
	Func      func()
}

Trigger defines a struct for trigger of schedules

type Triggers

type Triggers []*Trigger

Triggers defines slice of the Trigger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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