Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractResources ¶
func ExtractResources(sch *schema.Module) ([]*provisioner.Resource, error)
ExtractResources from a module schema
Types ¶
type Deployment ¶
Deployment is a single deployment of resources for a single module
func (*Deployment) Progress ¶
func (d *Deployment) Progress(ctx context.Context) (bool, error)
Progress the deployment. Returns true if there are still tasks running or pending.
func (*Deployment) State ¶
func (d *Deployment) State() *DeploymentState
type DeploymentState ¶
type PluginProvisioner ¶
type PluginProvisioner struct {
// contains filtered or unexported fields
}
PluginProvisioner delegates provisioning to an external plugin
func NewPluginProvisioner ¶
func NewPluginProvisioner(ctx context.Context, name, dir, exe string) (*PluginProvisioner, error)
func (*PluginProvisioner) Provision ¶
func (p *PluginProvisioner) Provision(ctx context.Context, module string, desired []*provisioner.ResourceContext, existing []*provisioner.Resource) (string, error)
func (*PluginProvisioner) State ¶
func (p *PluginProvisioner) State(ctx context.Context, token string, desired []*provisioner.Resource) (TaskState, []*provisioner.Resource, error)
type Provisioner ¶
type Provisioner interface { Provision(ctx context.Context, module string, desired []*provisioner.ResourceContext, existing []*provisioner.Resource) (string, error) State(ctx context.Context, token string, desired []*provisioner.Resource) (TaskState, []*provisioner.Resource, error) }
Provisioner is a runnable process to provision resources
type ProvisionerRegistry ¶
type ProvisionerRegistry struct {
Provisioners []*provisionerConfig
}
ProvisionerRegistry contains all known resource handlers in the order they should be executed
func (*ProvisionerRegistry) CreateDeployment ¶
func (reg *ProvisionerRegistry) CreateDeployment(module string, desiredResources, existingResources []*provisioner.Resource) *Deployment
CreateDeployment to take the system to the desired state
func (*ProvisionerRegistry) Register ¶
func (reg *ProvisionerRegistry) Register(handler Provisioner, types ...ResourceType)
Register to the registry, to be executed after all the previously added handlers
type ResourceType ¶
type ResourceType string
ResourceType is a type of resource used to configure provisioners
const ( ResourceTypeUnknown ResourceType = "unknown" ResourceTypePostgres ResourceType = "postgres" ResourceTypeMysql ResourceType = "mysql" )
Click to show internal directories.
Click to hide internal directories.