planner

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAsyncBashJob

func NewAsyncBashJob(caller string, metadata labels.Set, bin string, params []string) job.Job

TODO

func NewBashJob

func NewBashJob(caller string, metadata labels.Set, bin string, params []string) job.Job

Types

type Manager

type Manager interface {
	common.Service
	common.Debuggable
	common.Daemon
	Add(todo *TODO) 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 WithLogger

func WithLogger(logger log.Logger) Option

func WithName

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"`
}

type TODO

type TODO struct {
	ID          string     `json:"id"`
	Metadata    labels.Set `json:"metadata"`
	Description string     `json:"description"`
	Task        *task.Task `json:"task"`
}

Jump to

Keyboard shortcuts

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