daemon

package
v0.0.0-...-c52fe67 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon interface {
	Errors() <-chan error
	Messages() <-chan Message
	Name() string
	Start(c *cron.Cron)
	Stop()
	Execute(ctx context.Context) error
}

type DaemonResult

type DaemonResult struct {
	fx.Out

	Daemon Daemon `group:"daemon"`
}

type Message

type Message struct {
	Message string
	Fields  map[string]interface{}
}

type Option

type Option func(option *Worker)

func ScheduleOption

func ScheduleOption(value cron.Schedule) Option

type Worker

type Worker struct {
	Daemon Daemon
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(daemon Daemon, errCh chan<- error, opts ...Option) *Worker

func (*Worker) Start

func (w *Worker) Start(c *cron.Cron)

func (*Worker) Stop

func (w *Worker) Stop()

Jump to

Keyboard shortcuts

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