Documentation
¶
Overview ¶
Package fwfunction contains shared interfaces and structures for implementing behaviors in Terraform Provider function implementations.
Index ¶
- func MissingParameterNameDiag(functionName string, position *int64) diag.Diagnostic
- type ParameterWithValidateImplementation
- type ReturnWithValidateImplementation
- type ValidateParameterImplementationRequest
- type ValidateParameterImplementationResponse
- type ValidateReturnImplementationRequest
- type ValidateReturnImplementationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MissingParameterNameDiag ¶ added in v1.9.0
func MissingParameterNameDiag(functionName string, position *int64) diag.Diagnostic
Types ¶
type ParameterWithValidateImplementation ¶
type ParameterWithValidateImplementation interface { // ValidateImplementation should contain the logic which validates // the function.Parameter implementation. Since this logic can prevent the provider // from being usable, it should be very targeted and defensive against // false positives. ValidateImplementation(context.Context, ValidateParameterImplementationRequest, *ValidateParameterImplementationResponse) }
ParameterWithValidateImplementation is an optional interface on function.Parameter which enables validation of the provider-defined implementation for the function.Parameter. This logic runs during the GetProviderSchema RPC, or via provider-defined unit testing, to ensure the provider's definition is valid before further usage could cause other unexpected errors or panics.
type ReturnWithValidateImplementation ¶
type ReturnWithValidateImplementation interface { // ValidateImplementation should contain the logic which validates // the function.Return implementation. Since this logic can prevent the provider // from being usable, it should be very targeted and defensive against // false positives. ValidateImplementation(context.Context, ValidateReturnImplementationRequest, *ValidateReturnImplementationResponse) }
ReturnWithValidateImplementation is an optional interface on function.Return which enables validation of the provider-defined implementation for the function.Return. This logic runs during the GetProviderSchema RPC, or via provider-defined unit testing, to ensure the provider's definition is valid before further usage could cause other unexpected errors or panics.
type ValidateParameterImplementationRequest ¶
type ValidateParameterImplementationRequest struct { // FunctionName is the name of the function being validated. FunctionName string // ParameterPosition is the position of the parameter in the function definition for reporting diagnostics. // A parameter without a position (i.e. `nil`) is the variadic parameter. ParameterPosition *int64 }
ValidateParameterImplementationRequest contains the information available during a ValidateImplementation call to validate the function.Parameter definition. ValidateParameterImplementationResponse is the type used for responses.
type ValidateParameterImplementationResponse ¶
type ValidateParameterImplementationResponse struct { // Diagnostics report errors or warnings related to validating the // definition of the function.Parameter. An empty slice indicates success, with no // warnings or errors generated. Diagnostics diag.Diagnostics }
ValidateParameterImplementationResponse contains the returned data from a ValidateImplementation method call to validate the function.Parameter implementation. ValidateParameterImplementationRequest is the type used for requests.
type ValidateReturnImplementationRequest ¶
type ValidateReturnImplementationRequest struct{}
ValidateReturnImplementationRequest contains the information available during a ValidateImplementation call to validate the function.Return definition. ValidateReturnImplementationResponse is the type used for responses.
type ValidateReturnImplementationResponse ¶
type ValidateReturnImplementationResponse struct { // Diagnostics report errors or warnings related to validating the // definition of the function.Return. An empty slice indicates success, with no // warnings or errors generated. Diagnostics diag.Diagnostics }
ValidateReturnImplementationResponse contains the returned data from a ValidateImplementation method call to validate the function.Return implementation. ValidateReturnImplementationRequest is the type used for requests.