plugin

package
v0.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UNKNOWN it.TransportType = "unknown"
	SSH     it.TransportType = "ssh"
	K8S     it.TransportType = "kubernetes"
	NOMAD   it.TransportType = "nomad"
)

Variables

View Source
var TransportTypes = []it.TransportType{SSH, K8S, NOMAD}

Functions

func AttributePathError

func AttributePathError(err error, attributeNames ...string) error

func Server

func Server() tfprotov6.ProviderServer

Server returns a default instance of our ProviderServer.

func ValidationError

func ValidationError(msg string, attributeNames ...string) error

ValidationError creates a tftypes.AttributePathError, with the error message formatted as follows: "validation error, <msg>" The attributeNames represent the steps in the path to the attribute that failed validation.

func WithDefaultDataRouter

func WithDefaultDataRouter(overrides ...dr.DataSource) func(server.Server) server.Server

WithDefaultDataRouter creates a server opt that registers all the default datasources and optionally any provided overrides (or additional, non-default resources). The optional overrides argument is useful if you need to override a datasource in a test.

func WithDefaultResourceRouter

func WithDefaultResourceRouter(overrides ...rr.Resource) func(server.Server) server.Server

WithDefaultResourceRouter creates a server opt that registers all the default resources and optionally any provided overrides (or additional, non-default resources). The optional overrides argument is useful if you need to override a resource in a test.

Types

type FailureHandler

type FailureHandler func(ctx context.Context, errDiag *tfprotov6.Diagnostic, providerConfig tftypes.Value)

FailureHandler A function that can be used to handle state plan/apply failures and enhance the error diagnostic.

func GetApplicationLogsFailureHandler

func GetApplicationLogsFailureHandler(et *embeddedTransportV1, appNames []string) FailureHandler

GetApplicationLogsFailureHandler Creates a failure handler that fetches application logs, downloads them to a file and updates the error diagnostic with a list of logs that were retrieved and where they were saved.

func TransportDebugFailureHandler

func TransportDebugFailureHandler(et *embeddedTransportV1) FailureHandler

TransportDebugFailureHandler adds the transport configuration to the provided diagnostic.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements the internal server.Provider interface.

func (*Provider) Config

func (p *Provider) Config() tftypes.Value

Config returns the providers configuration as a Terraform5Value.

func (*Provider) Configure

Configure is called to pass the user-specified provider configuration to the provider.

func (*Provider) MetaSchema

func (p *Provider) MetaSchema() *tfprotov6.Schema

MetaSchema is the schema for the providers metadata.

func (*Provider) Schema

func (p *Provider) Schema() *tfprotov6.Schema

Schema is the provider user configuration schema.

func (*Provider) Stop

Stop is called when Terraform would like providers to shut down as quickly as possible, and usually represents an interrupt.

func (*Provider) Validate

Validate is called to give a provider a chance to validate the configuration.

type ResourceWithProviderConfig

type ResourceWithProviderConfig interface {
	SetProviderConfig(val tftypes.Value) error
	GetProviderConfig() (*config, error)
}

type StateWithTransport

type StateWithTransport interface {
	state.State
	EmbeddedTransport() *embeddedTransportV1
}

type TFType

type TFType interface {
	fmt.Stringer
	TFType() tftypes.Type
	TFValue() tftypes.Value
	FromTFValue(val tftypes.Value) error
}

type Transports

type Transports map[it.TransportType]transportState

Jump to

Keyboard shortcuts

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