-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert changes to docker implementation and add engine interface
[no ci]
- Loading branch information
1 parent
a3a3445
commit 8ec817b
Showing
2 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package worker | ||
|
||
import "context" | ||
|
||
type Engine interface { | ||
Pull(ctx context.Context, image string) error | ||
|
||
Run(ctx context.Context, config ContainerConfig) error | ||
|
||
Stop(ctx context.Context, containerID string) error | ||
|
||
Inspect(ctx context.Context, containerID string) (ContainerInfo, error) | ||
} | ||
|
||
type ContainerConfig struct { | ||
Image string | ||
Command []string | ||
Args []string | ||
EnvVars map[string]string | ||
Volumes []Volume | ||
} | ||
|
||
type ContainerInfo struct { | ||
ID string | ||
Name string | ||
Image string | ||
} |