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 Sim(ctx context.Context) error
- func WithAfter(names ...string) stepOpt
- func WithAptPackages(stepName string, packages ...string) option
- func WithBefore(names ...string) stepOpt
- 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 WithSim(f func(*Context) error) stepOpt
- func WithSteps(steps ...*Step) option
- type Context
- type InfoKey
- type Step
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 WithAfter ¶
func WithAfter(names ...string) stepOpt
WithAfter adds normal dependencies to the step
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 WithBefore ¶
func WithBefore(names ...string) stepOpt
WithBefore adds reverse dependencies to the step
func WithChildCmdBuilders ¶
func WithChildCmds ¶
func WithExtraAptInstall ¶
func WithExtraAptInstall(name string, opts ...stepOpt) option
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 ¶
func WithExtraAptUpdate(name string, opts ...stepOpt) option
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
}