cron

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cron contains methods for running actions as cron jobs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func At

func At(ctx context.Context, at time.Time, fn Action) error

At executes fn at the desired time. Aims to have an accuracy of within a second.

func Every

func Every(ctx context.Context, freq time.Duration, fn Action) error

Every invokes 'fn' every time the 'freq' duration passes. This will continue until the provided context is cancelled, or 'fn' returns an error.

Types

type Action

type Action func(context.Context) error

The Action type is a function that is invoked by a cron.

Jump to

Keyboard shortcuts

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