Documentation
¶
Index ¶
- func Clear[T any](ctx *Context, k InfoKey[T])
- func Configure(opts ...Option)
- func Get[T any](ctx *Context, k InfoKey[T]) (T, bool)
- func RunPlan(ctx context.Context, plan *Plan) error
- func Save[T any](ctx *Context, k InfoKey[T], v T)
- func Set[T any](ctx *Context, k InfoKey[T], v T)
- func SetNeedsReboot(ctx *Context)
- func SimPlan(ctx context.Context, plan *Plan) error
- func WithDefaultStepFactory(name string, f func() *Step)
- type Context
- type InfoKey
- type Option
- type Plan
- type Step
- type StepOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetNeedsReboot ¶ added in v0.5.0
func SetNeedsReboot(ctx *Context)
func WithDefaultStepFactory ¶ added in v0.5.0
WithDefaultStepFactory registers a function that will be called to create a default step with the given name. This is used to register steps that are referenced in existing step dependencies but not already added to the plan.
These steps essentially will be run if and only if some other step depends on them.
Normally this should only be used by bootstrap internals.
Types ¶
type Context ¶
func NewContext ¶
type Option ¶ added in v0.5.0
type Option func(*config)
func WithAlternatePlanCmd ¶ added in v0.5.0
WithAlternatePlanCmd registers a command that will run an alternate bootstrap plan from the given factory function.
The customize parameter is optional, if given it will be called and can customize the command to e.g. override the short help or add long help or other settings.
func WithChildCmdBuilders ¶
func WithChildCmds ¶
type Plan ¶ added in v0.5.0
type Plan struct {
// contains filtered or unexported fields
}
func NewDerivedPlan ¶ added in v0.5.0
NewDerivedPlan creates a new plan that is derived from the main plan, i.e. it has all of the steps copied to it, and you can then add more custom steps to it.
You can pass exceptions, steps you want to exclude from the copy, if you want to create a plan that has most but not all of the normal steps. It is up to you to ensure this doesn't create a plan with missing dependencies that can't be run.
Excluding a step that has a default factory may simply cause it to be re-added if other steps depend on it.
func (*Plan) AddDefaultSteps ¶ added in v0.5.0
func (p *Plan) AddDefaultSteps()
Add any of the known "Default" steps that are referenced in existing step dependencies but not already added to the plan.
func (*Plan) Ready ¶ added in v0.5.0
Ready tries to resolve all dependencies between plan steps to form a well-ordered plan. It returns whether this was successful.
You will usually want to call *Plan.AddDefaultSteps before this, or alternately do so if this fails before trying again.
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
type StepOpt ¶ added in v0.3.0
type StepOpt func(*Step)
func AfterSteps ¶ added in v0.3.0
AfterSteps adds normal dependencies to the step
func BeforeSteps ¶ added in v0.3.0
BeforeSteps adds reverse dependencies to the step
Directories
¶
| Path | Synopsis |
|---|---|
|
getkey
command
|
|
|
input
module
|
|
|
Package internal provides internal types and functions for the bootstrap addon.
|
Package internal provides internal types and functions for the bootstrap addon. |
|
Package textedit provides helpers for making changes to line-oriented text files.
|
Package textedit provides helpers for making changes to line-oriented text files. |