task

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTaskRunner

func NewTaskRunner(task Task) *taskRunner

Types

type CommandContext

type CommandContext struct {
	Bootstrapper       interfaces.Bootstrapper
	Provider           providers.Provider
	ClusterManager     interfaces.ClusterManager
	AddonManager       interfaces.AddonManager
	Validations        interfaces.Validator
	Writer             filewriter.FileWriter
	EksdInstaller      interfaces.EksdInstaller
	EksdUpgrader       interfaces.EksdUpgrader
	CAPIManager        interfaces.CAPIManager
	ClusterSpec        *cluster.Spec
	CurrentClusterSpec *cluster.Spec
	UpgradeChangeDiff  *types.ChangeDiff
	BootstrapCluster   *types.Cluster
	ManagementCluster  *types.Cluster
	WorkloadCluster    *types.Cluster
	Profiler           *Profiler
	OriginalError      error
}

Command context maintains the mutable and shared entities

func (*CommandContext) SetError

func (c *CommandContext) SetError(err error)

type Profiler

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

func (*Profiler) MarkDone

func (pp *Profiler) MarkDone(taskName string, msg string)

this can be used to profile sub tasks

func (*Profiler) MarkDoneTask

func (pp *Profiler) MarkDoneTask(taskName string)

needs to be called after setStart

func (*Profiler) Metrics

func (pp *Profiler) Metrics() map[string]map[string]time.Duration

get Metrics

func (*Profiler) SetStart

func (pp *Profiler) SetStart(taskName string, msg string)

this can be used to profile sub tasks

func (*Profiler) SetStartTask

func (pp *Profiler) SetStartTask(taskName string)

profiler for a Task

type Task

type Task interface {
	Run(ctx context.Context, commandContext *CommandContext) Task
	Name() string
}

Task is a logical unit of work - meant to be implemented by each Task

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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