Implement core functionality of AWS integration

This commit is contained in:
Maximilian Paß
2022-01-20 20:47:29 +01:00
parent dd41e0d5c4
commit 6123d20525
17 changed files with 360 additions and 157 deletions

View File

@@ -45,3 +45,14 @@ type Runner interface {
// Destroy destroys the Runner in Nomad.
Destroy() error
}
// NewContext creates a context containing a runner.
func NewContext(ctx context.Context, runner Runner) context.Context {
return context.WithValue(ctx, runnerContextKey, runner)
}
// FromContext returns a runner from a context.
func FromContext(ctx context.Context) (Runner, bool) {
runner, ok := ctx.Value(runnerContextKey).(Runner)
return runner, ok
}