FormulaProvider class

Serves formula:<id> resources out of the node's existing FormulaRegistry.

The bridge that makes blueprints work on day one: every formula a node already has — and every preset ever saved, once read through Ensure.fromAction — becomes a resource with nothing rewritten.

It is also the smallest provider there could be, because the formula engine already had both halves. Formula.status() is a read that does not change anything and reports absent / installed / running / stopped / unknown; Formula.run(action) is a write. All this does is decide which action a declared state calls for, and say plainly when there is none.

Implemented types

Constructors

FormulaProvider({required FormulaRegistry registry})
Creates a formula provider over registry.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
registry FormulaRegistry
The formulas this node can run.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedEnsure Set<Ensure>
The Ensure values this type can meaningfully be asked for.
no setteroverride
type String
The resource type this provider owns — the formula in formula:docker.
no setteroverride

Methods

apply(ResolvedResource resource, ResourceState current, FormulaContext context) Future<ResourceChange>
Moves the resource to its declared state.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(ResolvedResource resource, FormulaContext context) Future<ResourceState>
Looks at the node and reports what is there.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited