PackageFormula class abstract
A formula whose whole job is "make these commands exist".
Everything such a formula does is decided by two things: how to tell whether
the commands are already there, and what the package is called. This holds
the rest — picking the package manager on the host, because stepFor is
told the OS and not the distribution, and failing honestly where there is no
manager it knows.
Subclasses supply spec, verifyStep and packages. A formula that
manages a service wants more than this: start, stop and restart are not
package operations, and DockerFormula is written out by hand for that
reason.
- Inheritance
-
- Object
- Formula
- CommandFormula
- PackageFormula
- Implementers
Constructors
- PackageFormula({CommandExecutor executor = const ProcessCommandExecutor()})
- Creates a package-backed formula.
Properties
- executor → CommandExecutor
-
Runs the underlying commands.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- packages → PackageNames
-
What the package is called, per manager.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spec → FormulaSpec
-
The static metadata describing this formula.
no setterinherited
- verifyStep → CommandStep
-
The verify probe (e.g.
docker --version).no setterinherited - versionPattern → RegExp
-
A regex capturing the version from the verify output.
no setterinherited
Methods
-
install(
FormulaContext context) → Future< FormulaResult> -
Installs the managed software.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restart(
FormulaContext context) → Future< FormulaResult> -
Restarts the managed service.
inherited
-
run(
FormulaAction action, FormulaContext context) → Future< FormulaResult> -
Dispatches the given
actionto the matching method.inherited -
start(
FormulaContext context) → Future< FormulaResult> -
Starts the managed service.
inherited
-
status(
FormulaContext context) → Future< FormulaStatusReport> -
Present first, running second.
inherited
-
statusFrom(
ExecResult result) → FormulaStatus -
Maps a statusStepFor probe's outcome to a status.
inherited
-
statusStepFor(
String osName) → CommandStep? -
The probe that says whether what this formula manages is running, or
nullwhen it manages nothing that runs.inherited -
stepFor(
FormulaAction action, String osName) → CommandStep? -
Returns the command template for
actiononosName, ornullif the action is unsupported on that platform.override -
stop(
FormulaContext context) → Future< FormulaResult> -
Stops the managed service.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uninstall(
FormulaContext context) → Future< FormulaResult> -
Uninstalls the managed software.
inherited
-
update(
FormulaContext context) → Future< FormulaResult> -
Updates the managed software toward the target version.
inherited
-
validate(
FormulaContext context) → Future< ValidationResult> -
Validates that the managed software is present and healthy.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited