Documentation ¶
Index ¶
- func NewFakeServiceManagerClientFactory(offerings []types.ServiceOffering, plans []types.ServicePlan) *fakeServiceManagerClientFactory
- func NewPassthroughServiceManagerClientFactory(cli Client) *passthroughServiceManagerClientFactory
- type Binding
- type BindingResponse
- type Client
- type ClientFactory
- func (f *ClientFactory) ForCredentials(credentials *Credentials) Client
- func (f *ClientFactory) ForCustomerCredentials(reqCredentials *Credentials, log logrus.FieldLogger) (Client, error)
- func (f *ClientFactory) ProvideCredentials(reqCredentials *Credentials, log logrus.FieldLogger) (*Credentials, error)
- type Config
- type Credentials
- type DeprovisionResponse
- type HTTPResponse
- type InstanceKey
- type LastOperationResponse
- type LastOperationState
- type Metadata
- type OperationResponse
- type ProvisionRequest
- type ProvisionResponse
- type ProvisionResponseBody
- type ProvisioningInput
- type ServiceManagerOverrideMode
- type UnbindResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeServiceManagerClientFactory ¶
func NewFakeServiceManagerClientFactory(offerings []types.ServiceOffering, plans []types.ServicePlan) *fakeServiceManagerClientFactory
func NewPassthroughServiceManagerClientFactory ¶
func NewPassthroughServiceManagerClientFactory(cli Client) *passthroughServiceManagerClientFactory
Types ¶
type BindingResponse ¶
type BindingResponse struct { Binding HTTPResponse }
type Client ¶
type Client interface { ListOfferings() (*types.ServiceOfferings, error) ListOfferingsByName(name string) (*types.ServiceOfferings, error) ListPlansByName(planName, offeringID string) (*types.ServicePlans, error) Provision(brokerID string, request ProvisioningInput, acceptsIncomplete bool) (*ProvisionResponse, error) Deprovision(instanceKey InstanceKey, acceptsIncomplete bool) (*DeprovisionResponse, error) Bind(instanceKey InstanceKey, bindingID string, parameters interface{}, acceptsIncomplete bool) (*BindingResponse, error) Unbind(instanceKey InstanceKey, bindingID string, acceptsIncomplete bool) (*DeprovisionResponse, error) LastInstanceOperation(key InstanceKey, operationID string) (LastOperationResponse, error) }
func New ¶
func New(credentials Credentials) Client
func NewWithHttpClient ¶
func NewWithHttpClient(credentials Credentials, httpClient *http.Client) Client
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
func NewClientFactory ¶
func NewClientFactory(cfg Config) *ClientFactory
func (*ClientFactory) ForCredentials ¶
func (f *ClientFactory) ForCredentials(credentials *Credentials) Client
put here methods which creates SM client for different Credentials ...
func (*ClientFactory) ForCustomerCredentials ¶
func (f *ClientFactory) ForCustomerCredentials(reqCredentials *Credentials, log logrus.FieldLogger) (Client, error)
ForCustomerCredentials provides a client with request Credentials (see internal.ProvisioningParameters.ErsContext). Those Credentials could be overridden based on KEB configuration (OverrideMode).
func (*ClientFactory) ProvideCredentials ¶
func (f *ClientFactory) ProvideCredentials(reqCredentials *Credentials, log logrus.FieldLogger) (*Credentials, error)
type Config ¶
type Config struct { OverrideMode ServiceManagerOverrideMode `envconfig:"default=Never"` URL string Password string Username string }
type Credentials ¶
func (Credentials) WithNormalizedURL ¶
func (c Credentials) WithNormalizedURL() Credentials
type DeprovisionResponse ¶
type DeprovisionResponse struct { OperationResponse HTTPResponse }
type HTTPResponse ¶
type HTTPResponse struct {
StatusCode int
}
func (*HTTPResponse) IsDone ¶
func (pr *HTTPResponse) IsDone() bool
func (*HTTPResponse) IsInProgress ¶
func (pr *HTTPResponse) IsInProgress() bool
type InstanceKey ¶
InstanceKey contains all identifiers which allows us to perform all actions on an instance: - bind - unbind - deprovision
type LastOperationResponse ¶
type LastOperationResponse struct { State LastOperationState `json:"state"` Description string `json:"description"` }
type LastOperationState ¶
type LastOperationState string
const ( InProgress LastOperationState = "in progress" Succeeded LastOperationState = "succeeded" Failed LastOperationState = "failed" )
type OperationResponse ¶
type OperationResponse struct {
OperationID string `json:"operation"`
}
func (*OperationResponse) GetOperationID ¶
func (pr *OperationResponse) GetOperationID() string
type ProvisionRequest ¶
type ProvisionResponse ¶
type ProvisionResponse struct { ProvisionResponseBody HTTPResponse }
type ProvisionResponseBody ¶
type ProvisionResponseBody struct { OperationResponse `json:""` Async bool `json:"async"` DashboardURL *string `json:"dashboard_url,omitempty"` }
type ProvisioningInput ¶
type ProvisioningInput struct { ProvisionRequest ID string }
ProvisioningInput aggregates provisioning parameters
type ServiceManagerOverrideMode ¶
type ServiceManagerOverrideMode string
const ( SMOverrideModeAlways ServiceManagerOverrideMode = "Always" SMOverrideModeWhenNotSentInRequest ServiceManagerOverrideMode = "WhenNotSentInRequest" SMOverrideModeNever ServiceManagerOverrideMode = "Never" )
func (ServiceManagerOverrideMode) IsUnknown ¶
func (m ServiceManagerOverrideMode) IsUnknown() bool
func (ServiceManagerOverrideMode) Names ¶
func (m ServiceManagerOverrideMode) Names() string
func (*ServiceManagerOverrideMode) Unmarshal ¶
func (m *ServiceManagerOverrideMode) Unmarshal(in string) error
Unmarshal provides custom parsing of service manager credential mode. Implements envconfig.Unmarshal interface.
type UnbindResponse ¶
type UnbindResponse struct { OperationResponse HTTPResponse }
Click to show internal directories.
Click to hide internal directories.