ResourceProvider class abstract
Knows how to read and write one kind of resource on a node.
The extension seam of the whole blueprint system: supporting files, cron jobs or firewall rules means writing one of these, not touching the format, the resolver, the protocol or the dashboard.
Providers live on the node, not the Hub — the Hub cannot read a file on a machine a continent away, and a plan built from what the Hub last heard is a plan built from intentions. read is expected to shell out.
Two obligations, and the whole design rests on them:
- read must not change anything. It runs on every plan, including the ones nobody applies, and a drift check with side effects is not a check.
- apply must be safe to run twice. The planner will not call it when ResourceState.satisfies is already true, but a provider that cannot survive a repeat is one bad reading away from doing damage.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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 setter
- type → String
-
The resource type this provider owns — the
formulainformula:docker.no setter
Methods
-
apply(
ResolvedResource resource, ResourceState current, FormulaContext context) → Future< ResourceChange> - Moves the resource to its declared state.
-
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.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited