Documentation ¶
Overview ¶
Package grafton provides A simple interface to the provider api. it is used both within the grafton test tool, and by our own internal services.
Index ¶
- func CreateSsoURL(base *nurl.URL, code string, resourceID manifold.ID) *nurl.URL
- func ToError(err error) manifold.HTTPError
- type Client
- func (c *Client) ChangePlan(ctx context.Context, cbID, resourceID manifold.ID, newPlan string) (string, bool, error)
- func (c *Client) CreateSsoURL(code string, resourceID manifold.ID) *nurl.URL
- func (c *Client) DeprovisionCredentials(ctx context.Context, cbID, credentialID manifold.ID) (string, bool, error)
- func (c *Client) DeprovisionResource(ctx context.Context, cbID, resourceID manifold.ID) (string, bool, error)
- func (c *Client) ProvisionCredentials(ctx context.Context, cbID, resID, credID manifold.ID) (map[string]string, string, bool, error)
- func (c *Client) ProvisionResource(ctx context.Context, cbID, resID manifold.ID, product, plan, region string) (string, bool, error)
- type Error
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSsoURL ¶ added in v0.7.0
CreateSsoURL generates and returns a *url.URL to initiate a single sign-on request against the provided base url, code, and resourceID.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around the generated provisioning api client, providing convenience methods, and signing outgoing requests.
func (*Client) ChangePlan ¶
func (c *Client) ChangePlan(ctx context.Context, cbID, resourceID manifold.ID, newPlan string) (string, bool, error)
ChangePlan makes a patch call to change the resource's plan.
func (*Client) CreateSsoURL ¶
CreateSsoURL Generates and returns a *url.URL to initiate single sign-on against the provider for this client.
func (*Client) DeprovisionCredentials ¶
func (c *Client) DeprovisionCredentials(ctx context.Context, cbID, credentialID manifold.ID) (string, bool, error)
DeprovisionCredentials deletes credentials from the remote provider.
A message will be presented if a callback is provided
func (*Client) DeprovisionResource ¶
func (c *Client) DeprovisionResource(ctx context.Context, cbID, resourceID manifold.ID) (string, bool, error)
DeprovisionResource deletes resources from the remote provider.
type Error ¶
Error is the error type we'll use for providers to return.
func (*Error) StatusCode ¶
StatusCode returns the StatusCode for the current error type.
func (*Error) WriteResponse ¶
func (e *Error) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
WriteResponse completes the interface for a HTTPError; enabling an error to be returned as a middleware.Responder from go-openapi/runtime
A panic will occur if the given producer errors.