Documentation ¶
Index ¶
- func GetAutoscalerTask(connectorWrapper *connector.Wrapper, taskID string) (model.Task, error)
- func GetDraasTask(connectorWrapper *connector.Wrapper, taskID string) (model.Task, error)
- func GetTask(connectorWrapper *connector.Wrapper, taskID string) (model.Task, error)
- func GetV2Task(connectorWrapper *connector.Wrapper, taskID string) (model.Task, error)
- func RetryTaskUntilFinished(authenticator connector.Authenticator, taskSupplier func() (model.Task, error), ...) *resource.RetryError
- type HTTPClient
- type KeyedMutex
- type V2Client
- type V2ClientImpl
- type V2State
- type V2Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAutoscalerTask ¶
GetAutoscalerTask polls autoscalerapi for task with specified ID and converts it to model.Task
func GetDraasTask ¶
GetDraasTask polls draas API for task with specified ID and converts it to model.Task
func RetryTaskUntilFinished ¶
func RetryTaskUntilFinished(authenticator connector.Authenticator, taskSupplier func() (model.Task, error), errorMessage string, finishCallback func(task model.Task)) *resource.RetryError
RetryTaskUntilFinished function that will poll (using provided task supplier) for a task state until a non-recoverable error is encountered, like task failure or authentication error or until the task finishes. An option to execute a callback after task finish (either successfully or not) is provided.
Types ¶
type HTTPClient ¶ added in v1.12.0
HTTPClient an interface, that is implemented by the http.DefaultClient, intended to enable stubbing for testing purposes
type KeyedMutex ¶
type KeyedMutex struct {
// contains filtered or unexported fields
}
KeyedMutex Mutex that operates multiple locks, based on a string key.
func (*KeyedMutex) Lock ¶
func (keyedMutex *KeyedMutex) Lock(key string) func()
Lock Locks on a key, allowing multiple threads to operate on separate keys. Returns a function, that clients should use to unlock the locks they've obtained.
type V2Client ¶ added in v1.12.0
type V2Client interface { connector.Authenticator GetTask(taskID string) (V2Task, error) }
type V2ClientImpl ¶ added in v1.12.0
type V2ClientImpl struct { HTTPClient HTTPClient // contains filtered or unexported fields }
func NewV2ClientImpl ¶ added in v1.12.0
func NewV2ClientImpl(wrapper connector.Wrapper) *V2ClientImpl
func (*V2ClientImpl) Authenticate ¶ added in v1.12.0
func (client *V2ClientImpl) Authenticate() error
Authenticate grab an access token and set it into the V2Client instance for later use