Documentation
¶
Index ¶
- Constants
- func AddAptPackages(ctx *Context, names ...string)
- func ChangedAptSources(ctx *Context)
- func Configure(opts ...option)
- func Get[T any](ctx *Context, k InfoKey[T]) (T, bool)
- func NewPlan() *plan
- func Run(ctx context.Context) error
- func Save[T any](ctx *Context, k InfoKey[T], v T)
- func Set[T any](ctx *Context, k InfoKey[T], v T)
- func Sim(ctx context.Context) error
- func WithAptPackages(stepName string, packages ...string) option
- func WithChildCmdBuilders(fns ...func() *cobra.Command) option
- func WithChildCmds(cmds ...*cobra.Command) option
- func WithExtraAptInstall(name string, opts ...StepOpt) option
- func WithExtraAptUpdate(name string, opts ...StepOpt) option
- func WithSteps(steps ...*Step) option
- type Context
- type InfoKey
- type Step
- type StepOpt
Constants ¶
const StepNameAptInstall = "apt install"
Name of the step registered by [AddAptInstall]. This step will install pending packages enqueued with AddAptPackages. Set any step that uses that to be before this step.
const StepNameAptUpdate = "apt update"
Name of the step registered by [AddAptUpdate]. Steps that modify apt sources should reference this as a `before` constraint.
Variables ¶
This section is empty.
Functions ¶
func AddAptPackages ¶
AddAptPackages adds the given package names to the pending list of packages to install. They will be installed by the next `apt install` step, either the "main" one, or one registered by WithExtraAptInstall.
The caller is responsible for ensuring that such a step runs after this.
func ChangedAptSources ¶
func ChangedAptSources(ctx *Context)
ChangedAptSources will mark the apt sources list as dirty, so a secondary `apt update` step registered with WithExtraAptUpdate will actually run.
func WithAptPackages ¶
WithAptPackages is an option for Configure that will register a step to mark the given package(s) to be installed by the main `apt install` step.
func WithChildCmdBuilders ¶
func WithChildCmds ¶
func WithExtraAptInstall ¶
WithExtraAptInstall adds a secondary `apt install` step with the given name. It will always run after the main `apt install` step. You may pass additional ordering constraints in the options.
You likely want to pair this with WithExtraAptUpdate, one or more steps to add new apt sources that call ChangedAptSources and AddAptPackages.
func WithExtraAptUpdate ¶
WithExtraAptUpdate adds a secondary `apt update` step with the given name. It will always run after the main `apt update` step. You may pass additional ordering constraints in the options.
Types ¶
type Context ¶
func NewContext ¶
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
func AddAptPackagesStep ¶ added in v0.3.0
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. |