rsrc

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanConfigValidators

type CanConfigValidators interface {
	ConfigValidators(context.Context) []resource.ConfigValidator
}

CanConfigValidators optional interface to inject config validators method on resource block.

type CanConfigure

type CanConfigure interface {
	Configure(context.Context, resource.ConfigureRequest, *resource.ConfigureResponse)
}

CanConfigure optional interface to inject configure method on resource block.

type CanImportState

type CanImportState interface {
	ImportState(context.Context, resource.ImportStateRequest, *resource.ImportStateResponse)
}

CanImportState optional interface to inject import state method on resource block.

type CanMetadata

type CanMetadata interface {
	Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
}

CanMetadata optional interface to inject metadata method on resource block.

type CanModifyPlan

type CanModifyPlan interface {
	ModifyPlan(context.Context, resource.ModifyPlanRequest, *resource.ModifyPlanResponse)
}

CanModifyPlan optional interface to inject modify plan method on resource block.

type CanSchema

type CanSchema interface {
	Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
}

CanSchema optional interface to inject schema method on resource block.

type CanUpgradeState

type CanUpgradeState interface {
	UpgradeState(context.Context) map[int64]resource.StateUpgrader
}

CanUpgradeState optional interface to inject upgrade state method on resource block.

type CanValidateConfig

type CanValidateConfig interface {
	ValidateConfig(context.Context, resource.ValidateConfigRequest, *resource.ValidateConfigResponse)
}

CanValidateConfig optional interface to inject validate config method on resource block.

type Resource

type Resource[T any] interface {
	// Create receive a context, a CreateRequest, a CreateResponse and a data object filled with the data from the resource.
	// It should return the same or update data object updated or diag.Diagnostics if error occurs during the creation.
	Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse, data T) (T, diag.Diagnostics)
	// Read receive a context, a ReadRequest, a ReadResponse and a data object filled with the data from the resource.
	// It should return the same or update data object updated or diag.Diagnostics if error occurs during the read.
	Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse, data T) (T, diag.Diagnostics)
	// Update receives a context, a UpdateRequest, a UpdateResponse and a data object filled with the data from the resource.
	// It should return the same or update data object updated or diag.Diagnostics if error occurs during the update.
	Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse, data T) (T, diag.Diagnostics)
	// Delete receive a context, a DeleteRequest, a DeleteResponse and a data object filled with the data from the resource.
	// It should return the same or update data object updated or diag.Diagnostics if error occurs during the deletion.
	Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse, data T) diag.Diagnostics
}

Resource required methods on datasource block.

T is the protobuf message generated by protoc-gen-go.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL