Runtime Retries Limit (#1163)

* Implement Runtime Retries

* Remove Debug

* Action Feedback

* Refactor Retries

* Fix WithRetires Typo
This commit is contained in:
ben-toogood
2020-02-07 12:02:41 +00:00
committed by GitHub
parent 19c454ec4b
commit fe7f5a4134
6 changed files with 90 additions and 70 deletions

View File

@@ -51,6 +51,8 @@ type CreateOptions struct {
Output io.Writer
// Type of service to create
Type string
// Retries before failing deploy
Retries int
}
// ReadOptions queries runtime services
@@ -78,6 +80,13 @@ func WithCommand(args ...string) CreateOption {
}
}
// WithRetries sets the max retries attemps
func WithRetries(retries int) CreateOption {
return func(o *CreateOptions) {
o.Retries = retries
}
}
// WithEnv sets the created service environment
func WithEnv(env []string) CreateOption {
return func(o *CreateOptions) {
@@ -99,7 +108,7 @@ func ReadService(service string) ReadOption {
}
}
// WithVersion confifgures service version
// ReadVersion confifgures service version
func ReadVersion(version string) ReadOption {
return func(o *ReadOptions) {
o.Version = version