kron

package
v0.26.7 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	MaxErrors int
	Handler   JobHandler
	Interval  time.Duration
	// contains filtered or unexported fields
}

func NewJob

func NewJob(interval time.Duration, handler JobHandler) *Job

func (*Job) AddMiddleware

func (j *Job) AddMiddleware(middleware MiddlewareFunc)

type JobHandler

type JobHandler func(ctx context.Context) error

type MiddlewareFunc

type MiddlewareFunc func(ctx context.Context) (context.Context, error)

type Service

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

func NewService

func NewService() *Service

func (*Service) AddJob

func (s *Service) AddJob(job *Job)

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

func (*Service) Stop

func (s *Service) Stop() error

Jump to

Keyboard shortcuts

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