tasks

package
v0.0.0-...-8bf0aa5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRegistry = registry{}

Functions

func Client

func Client(ctx context.Context) *agent.Client

Client returns the gRPC client from the context

func Database

func Database(ctx context.Context) agent.Database

Database returns the agent database available in the task context

func Logger

func Logger(ctx context.Context) *zap.Logger

Logger returns the task's logger from the context

Types

type Executor

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

func NewExecutor

func NewExecutor(tomb *tomb.Tomb, db agent.Database, logger *zap.Logger, client *agent.Client) *Executor

func (*Executor) Initialize

func (e *Executor) Initialize()

type Interval

type Interval time.Duration

Interval is a schedule that runs at a fixed Interval

type RunOnceNow

type RunOnceNow struct{}

RunOnceNow is a schedule that runs once, immediately when next is called and then never runs again until the process is restarted.

type Task

type Task struct {
	Name     string
	Schedule schedule
	Action   func(ctx context.Context) error
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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