module library
The surface a module built on top of rig is entitled to.
rig_postgres is the first module built on rig, and it needed pieces of
engine.dart — the lock, the project name — that library's own doc
comment disclaims as unstable. Depending on engine.dart would have tied
every future module to a library that changes with whatever rig itself
needs next.
This library is different: it is a promise. A module may depend on exactly what is exported here, and it will not move out from under it.
Classes
- AcquiredContainer
- A container that exists, is running, and is ready to use.
- ContainerLease
- A container a test is using.
- DockerEngine
- The slice of the Docker Engine API that rig needs.
- ExecResult
- What a command run inside a container produced.
Functions
-
currentEngine(
{Future< DockerEngine> connect() = connectToDocker}) → Future<DockerEngine> - The Docker client for this isolate, connected on first use.
-
currentProjectName(
{Directory? from}) → String - The pubspec name of the package the tests belong to, for labelling.
-
overrideEngine(
DockerEngine engine) → void -
Makes
enginethe client this isolate uses. For rig's own tests and for module tests. -
specHash(
ContainerSpec spec, {int maxMountBytes = defaultMaxMountBytes}) → String - The key rig uses to decide whether a container it already runs can serve this spec.
-
withExclusiveLock<
T> (String lockPath, Future< T> body(), {Duration staleAfter = defaultLockStaleAfter, Duration timeout = _defaultTimeout, Duration retryInterval = _defaultRetryInterval, DateTime now() = DateTime.now, Future<void> sleep(Duration) = _delay}) → Future<T> -
Run
bodywith nothing else holdinglockPath.