worker

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 6 Imported by: 0

README

job

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Init

func Init() error

func Register

func Register(name string, fn jobFunc, interval time.Duration)

Registar a Job

func Work

func Work(logger Logger) error

Work executes all registered jobs

Types

type Job

type Job struct {
	Name     string
	Fn       jobFunc
	Interval time.Duration
}

type Logger

type Logger interface {
	Error(err error)
}

Jump to

Keyboard shortcuts

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