task

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	common.Service
	common.Debuggable
	common.Daemon
	Create(id string, fn job.Func, opts ...job.Option) (job.Job, error)
	Execute(ctx context.Context, t job.Job, schedule string, prioriry int, opts ...executor.Option) error
	Cancel(id string) error
	Delete(id string, force bool) error
	GetResult(id string) (any, error)
	Stats(opts StatsOptions) ([]*Stats, error)
}

func New

func New(es common.EventSender, opts ...Option) Manager

type Option

type Option func(*manager)

func WithDefaults

func WithDefaults(opts ...job.Option) Option

func WithLogger added in v0.0.2

func WithLogger(logger log.Logger) Option

func WithName added in v0.0.2

func WithName(name string) Option

type Stats

type Stats struct {
	ID            string        `json:"id"`
	Schedule      string        `json:"schedule"`
	State         string        `json:"state"`
	Progress      float64       `json:"progress"`
	StartedAt     time.Time     `json:"started_at"`
	ExecutionTime time.Duration `json:"execution_time"`
	Cooldown      time.Duration `json:"cooldown"`
	Retries       uint          `json:"retries"`
	Labels        labels.Set    `json:"labels"`
	Error         string        `json:"error"`
}

type StatsOptions

type StatsOptions struct {
	Selector string `json:"selector,omitempty"`
	All      bool   `json:"all"`
}

Jump to

Keyboard shortcuts

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