fwfunction

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fwfunction contains shared interfaces and structures for implementing behaviors in Terraform Provider function implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 {
	// 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

	// Name is the provider-defined parameter name or the default parameter name for reporting diagnostics.
	//
	// MAINTAINER NOTE: Since parameter names are not required currently and can be defaulted by internal framework logic,
	// we accept the Name in this validate request, rather than using `(function.Parameter).GetName()` for diagnostics, which
	// could be empty.
	Name string
}

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.

Jump to

Keyboard shortcuts

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