Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory interface {
// Manager returns a Manager that manages cloud resources on behalf of a
// particular set of cloud credentials
Manager(
schema.Kind,
credentials.Credentials,
) (Manager, error)
}
Factory returns a Manager that can be used to manage cloud resources for a particular Resource Kind and cloud credentials
type Manager ¶
type Manager interface {
// Get returns the currently-observed state of the supplied Resource in
// the backend cloud service API.
//
// Implementers should return (nil, pkg/errors.NotFound) when the backend
// cloud service API cannot find the resource.
Get(
context.Context,
resource.Identifiers,
) (resource.Resource, error)
// Create attempts to create the supplied Resource in the backend cloud
// service API, returning a Resource representing the newly-created
// resource
Create(
context.Context,
resource.Resource,
) (resource.Resource, error)
// Update attempts to mutate the supplied desired Resource in the backend
// cloud service API, returning a Resource representing the newly-mutated
// resource.
//
// A `compare.Delta` is provided to help implementing structs understand
// which fields between the desired and latest resources have changed.
Update(
context.Context,
resource.Resource,
resource.Resource,
*compare.Delta,
) (resource.Resource, error)
// Delete attempts to destroy the supplied Resource in the backend cloud
// service API, returning a Resource representing the resource being
// deleted (if delete is asynchronous and takes time)
Delete(
context.Context,
resource.Resource,
) (resource.Resource, error)
}
Manager is responsible for providing a consistent way to perform CRUD operations in a backend cloud service API for Resources.
Use a Factory to create a Manager for a particular Kind and Credentials.
Click to show internal directories.
Click to hide internal directories.