Documentation
¶
Index ¶
- func ConfigureDataSource(req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) *common.DatabricksClient
- func ConfigureResource(req resource.ConfigureRequest, resp *resource.ConfigureResponse) *common.DatabricksClient
- func DiagToString(d diag.Diagnostics) string
- func GetDatabricksProductionName(name string) string
- func GetDatabricksStagingName(name string) string
- type ComplexFieldTypeProvider
- type ObjectTypable
- type ObjectTyper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureDataSource ¶
func ConfigureDataSource(req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) *common.DatabricksClient
ConfigureDataSource is a helper function for configuring a general data source. It returns the DatabricksClient if it can be successfully fetched from the ProviderData in the request; otherwise, the error is appended to the diagnostics of the response.
func ConfigureResource ¶
func ConfigureResource(req resource.ConfigureRequest, resp *resource.ConfigureResponse) *common.DatabricksClient
ConfigureDataSource is a helper function for configuring a general resource. It returns the DatabricksClient if it can be successfully fetched from the ProviderData in the request; otherwise, the error is appended to the diagnostics of the response.
func DiagToString ¶ added in v1.61.0
func DiagToString(d diag.Diagnostics) string
DiagToString converts a slice of diag.Diagnostics to a string.
func GetDatabricksProductionName ¶ added in v1.54.0
func GetDatabricksStagingName ¶ added in v1.54.0
GetDatabricksStagingName returns the resource name for a given resource with _pluginframework suffix. Once a migrated resource is ready to be used as default, the Metadata method for that resource should be updated to use GetDatabricksProductionName.
Types ¶
type ComplexFieldTypeProvider ¶ added in v1.61.0
type ComplexFieldTypeProvider interface { // GetComplexFieldTypes returns a map from field name to the type of the value in // the list, map or object. The keys of the map must match the value of the // `tfsdk` tag on the field. There must be one entry in the map for each field // that has type types.List, types.Map or types.Object. // // If the field has type types.List or types.Map, the reflect.Type instance may // correspond to either a primitive value (e.g. types.String) or a TFSDK structure. // It is not allowed to return a reflect.Type that corresponds to a type value // (e.g. types.StringType). // // If the field has type types.Object, the reflect.Type instance must correspond // to a TFSDK structure. GetComplexFieldTypes(context.Context) map[string]reflect.Type }
ComplexFieldTypeProvider must be implemented by any TFSDK structure that contains a complex field (list, map, object). Such fields do not include sufficient type information to understand the type of the contained elements in the case of a list or map, or the fields in the case of an object. This interface enables callers to recover that information.
type ObjectTypable ¶ added in v1.61.0
type ObjectTypable interface { // Type returns the corresponding attr.Type for the object. For TF SDK types, // this must always return an instance of basetypes.ObjectType. Type(context.Context) attr.Type }
An ObjectTypable is an object that has a corresponding attr.Type. Note that this is different from the plugin framework's ObjectTypable interface, which is used to implement custom types in the plugin framework. Today, the serialization to plugin framework types is done in the converters package.
func NewObjectTyper ¶ added in v1.61.0
func NewObjectTyper(inner any) ObjectTypable
Construct a new ObjectTyper. TFSDK structs automatically implement ObjectTypable, so they are returned as-is. Hand-written structs do not necessarily implement ObjectTypable, so this is a convenience implementation using reflection.
type ObjectTyper ¶ added in v1.61.0
type ObjectTyper struct {
// contains filtered or unexported fields
}