deploytest

package
v3.114.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHostIsClosed = errors.New("plugin host is shutting down")
View Source
var ErrLanguageRuntimeIsClosed = errors.New("language runtime is shutting down")
View Source
var UseGrpcPluginsByDefault = false

Functions

func NewLanguageRuntime

func NewLanguageRuntime(program ProgramFunc, requiredPlugins ...workspace.PluginSpec) plugin.LanguageRuntime

func NewPluginHost

func NewPluginHost(sink, statusSink diag.Sink, languageRuntime plugin.LanguageRuntime,
	pluginLoaders ...*ProviderLoader,
) plugin.Host

func WithGrpc

func WithGrpc(p *PluginLoader)

func WithPath added in v3.35.0

func WithPath(path string) func(p *PluginLoader)

func WithoutGrpc

func WithoutGrpc(p *PluginLoader)

Types

type Analyzer added in v3.22.0

type Analyzer struct {
	Info plugin.AnalyzerInfo

	AnalyzeF      func(r plugin.AnalyzerResource) ([]plugin.AnalyzeDiagnostic, error)
	AnalyzeStackF func(resources []plugin.AnalyzerStackResource) ([]plugin.AnalyzeDiagnostic, error)
	RemediateF    func(r plugin.AnalyzerResource) ([]plugin.Remediation, error)

	ConfigureF func(policyConfig map[string]plugin.AnalyzerPolicyConfig) error
}

func (*Analyzer) Analyze added in v3.22.0

func (*Analyzer) AnalyzeStack added in v3.22.0

func (a *Analyzer) AnalyzeStack(resources []plugin.AnalyzerStackResource) ([]plugin.AnalyzeDiagnostic, error)

func (*Analyzer) Close added in v3.22.0

func (a *Analyzer) Close() error

func (*Analyzer) Configure added in v3.22.0

func (a *Analyzer) Configure(policyConfig map[string]plugin.AnalyzerPolicyConfig) error

func (*Analyzer) GetAnalyzerInfo added in v3.22.0

func (a *Analyzer) GetAnalyzerInfo() (plugin.AnalyzerInfo, error)

func (*Analyzer) GetPluginInfo added in v3.22.0

func (a *Analyzer) GetPluginInfo() (workspace.PluginInfo, error)

func (*Analyzer) Name added in v3.22.0

func (a *Analyzer) Name() tokens.QName

func (*Analyzer) Remediate added in v3.88.0

func (a *Analyzer) Remediate(r plugin.AnalyzerResource) ([]plugin.Remediation, error)

type BackendClient

type BackendClient struct {
	GetStackOutputsF         func(ctx context.Context, name string) (resource.PropertyMap, error)
	GetStackResourceOutputsF func(ctx context.Context, name string) (resource.PropertyMap, error)
}

BackendClient provides a simple implementation of deploy.BackendClient that defers to a function value.

func (*BackendClient) GetStackOutputs

func (b *BackendClient) GetStackOutputs(ctx context.Context, name string) (resource.PropertyMap, error)

GetStackOutputs returns the outputs (if any) for the named stack or an error if the stack cannot be found.

func (*BackendClient) GetStackResourceOutputs

func (b *BackendClient) GetStackResourceOutputs(
	ctx context.Context, name string,
) (resource.PropertyMap, error)

GetStackResourceOutputs returns the resource outputs for a stack, or an error if the stack cannot be found. Resources are retrieved from the latest stack snapshot, which may include ongoing updates. They are returned in a `PropertyMap` mapping resource URN to another `Propertymap` with members `type` (containing the Pulumi type ID for the resource) and `outputs` (containing the resource outputs themselves).

type CallbackServer added in v3.107.0

type CallbackServer struct {
	pulumirpc.UnsafeCallbacksServer
	// contains filtered or unexported fields
}

func NewCallbacksServer added in v3.107.0

func NewCallbacksServer() (*CallbackServer, error)

func (*CallbackServer) Allocate added in v3.107.0

func (s *CallbackServer) Allocate(
	callback func(args []byte,
	) (proto.Message, error),
) (*pulumirpc.Callback, error)

func (*CallbackServer) Close added in v3.107.0

func (s *CallbackServer) Close() error

func (*CallbackServer) Invoke added in v3.107.0

type LanguageRuntimeFactory added in v3.87.0

type LanguageRuntimeFactory func() plugin.LanguageRuntime

func NewLanguageRuntimeF added in v3.87.0

func NewLanguageRuntimeF(program ProgramFunc, requiredPlugins ...workspace.PluginSpec) LanguageRuntimeFactory

type LoadAnalyzerFunc added in v3.22.0

type LoadAnalyzerFunc func(opts *plugin.PolicyAnalyzerOptions) (plugin.Analyzer, error)

type LoadAnalyzerWithHostFunc added in v3.22.0

type LoadAnalyzerWithHostFunc func(opts *plugin.PolicyAnalyzerOptions, host plugin.Host) (plugin.Analyzer, error)

type LoadPluginFunc added in v3.22.0

type LoadPluginFunc func(opts interface{}) (interface{}, error)

type LoadPluginWithHostFunc added in v3.22.0

type LoadPluginWithHostFunc func(opts interface{}, host plugin.Host) (interface{}, error)

type LoadProviderFunc

type LoadProviderFunc func() (plugin.Provider, error)

type LoadProviderWithHostFunc

type LoadProviderWithHostFunc func(host plugin.Host) (plugin.Provider, error)

type NoopSink added in v3.99.0

type NoopSink struct {
	LogfF func(sev diag.Severity, diag *diag.Diag, args ...interface{})
}

func (*NoopSink) Debugf added in v3.99.0

func (s *NoopSink) Debugf(diag *diag.Diag, args ...interface{})

func (*NoopSink) Errorf added in v3.99.0

func (s *NoopSink) Errorf(diag *diag.Diag, args ...interface{})

func (*NoopSink) Infoerrf added in v3.99.0

func (s *NoopSink) Infoerrf(diag *diag.Diag, args ...interface{})

func (*NoopSink) Infof added in v3.99.0

func (s *NoopSink) Infof(diag *diag.Diag, args ...interface{})

func (*NoopSink) Logf added in v3.99.0

func (s *NoopSink) Logf(sev diag.Severity, diag *diag.Diag, args ...interface{})

func (*NoopSink) Stringify added in v3.99.0

func (s *NoopSink) Stringify(
	sev diag.Severity, diag *diag.Diag, args ...interface{},
) (string, string)

func (*NoopSink) Warningf added in v3.99.0

func (s *NoopSink) Warningf(diag *diag.Diag, args ...interface{})

type PluginHostFactory added in v3.87.0

type PluginHostFactory func() plugin.Host

func NewPluginHostF added in v3.87.0

func NewPluginHostF(sink, statusSink diag.Sink, languageRuntimeF LanguageRuntimeFactory,
	pluginLoaders ...*ProviderLoader,
) PluginHostFactory

NewPluginHostF returns a factory that produces a plugin host for an operation.

type PluginLoader added in v3.22.0

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

func NewAnalyzerLoader added in v3.22.0

func NewAnalyzerLoader(name string, load LoadAnalyzerFunc, opts ...PluginOption) *PluginLoader

func NewAnalyzerLoaderWithHost added in v3.22.0

func NewAnalyzerLoaderWithHost(name string, load LoadAnalyzerWithHostFunc, opts ...PluginOption) *PluginLoader

type PluginOption added in v3.22.0

type PluginOption func(p *PluginLoader)

type ProgramFunc

type ProgramFunc func(runInfo plugin.RunInfo, monitor *ResourceMonitor) error

type Provider

type Provider struct {
	Name    string
	Package tokens.Package
	Version semver.Version

	Config resource.PropertyMap

	DialMonitorF func(ctx context.Context, endpoint string) (*ResourceMonitor, error)

	GetSchemaF func(version int) ([]byte, error)

	CheckConfigF func(urn resource.URN, olds,
		news resource.PropertyMap, allowUnknowns bool) (resource.PropertyMap, []plugin.CheckFailure, error)
	DiffConfigF func(urn resource.URN, oldInputs, oldOutputs, newInputs resource.PropertyMap,
		ignoreChanges []string) (plugin.DiffResult, error)
	ConfigureF func(news resource.PropertyMap) error

	CheckF func(urn resource.URN,
		olds, news resource.PropertyMap, randomSeed []byte) (resource.PropertyMap, []plugin.CheckFailure, error)
	DiffF func(urn resource.URN, id resource.ID, oldInputs, oldOutputs, newInputs resource.PropertyMap,
		ignoreChanges []string) (plugin.DiffResult, error)
	CreateF func(urn resource.URN, inputs resource.PropertyMap, timeout float64,
		preview bool) (resource.ID, resource.PropertyMap, resource.Status, error)
	UpdateF func(urn resource.URN, id resource.ID, oldInputs, oldOutputs, newInputs resource.PropertyMap, timeout float64,
		ignoreChanges []string, preview bool) (resource.PropertyMap, resource.Status, error)
	DeleteF func(urn resource.URN, id resource.ID,
		oldInputs, oldOutputs resource.PropertyMap, timeout float64) (resource.Status, error)
	ReadF func(urn resource.URN, id resource.ID,
		inputs, state resource.PropertyMap) (plugin.ReadResult, resource.Status, error)

	ConstructF func(monitor *ResourceMonitor, typ, name string, parent resource.URN, inputs resource.PropertyMap,
		info plugin.ConstructInfo, options plugin.ConstructOptions) (plugin.ConstructResult, error)

	InvokeF func(tok tokens.ModuleMember,
		inputs resource.PropertyMap) (resource.PropertyMap, []plugin.CheckFailure, error)
	StreamInvokeF func(tok tokens.ModuleMember, args resource.PropertyMap,
		onNext func(resource.PropertyMap) error) ([]plugin.CheckFailure, error)

	CallF func(monitor *ResourceMonitor, tok tokens.ModuleMember, args resource.PropertyMap, info plugin.CallInfo,
		options plugin.CallOptions) (plugin.CallResult, error)

	CancelF func() error

	GetMappingF  func(key, provider string) ([]byte, string, error)
	GetMappingsF func(key string) ([]string, error)
	// contains filtered or unexported fields
}

func (*Provider) Call added in v3.6.0

func (*Provider) Check

func (prov *Provider) Check(urn resource.URN,
	olds, news resource.PropertyMap, _ bool, randomSeed []byte,
) (resource.PropertyMap, []plugin.CheckFailure, error)

func (*Provider) CheckConfig

func (prov *Provider) CheckConfig(urn resource.URN, olds,
	news resource.PropertyMap, allowUnknowns bool,
) (resource.PropertyMap, []plugin.CheckFailure, error)

func (*Provider) Close

func (prov *Provider) Close() error

func (*Provider) Configure

func (prov *Provider) Configure(inputs resource.PropertyMap) error

func (*Provider) Construct

func (prov *Provider) Construct(info plugin.ConstructInfo, typ tokens.Type, name string, parent resource.URN,
	inputs resource.PropertyMap, options plugin.ConstructOptions,
) (plugin.ConstructResult, error)

func (*Provider) Create

func (prov *Provider) Create(urn resource.URN, props resource.PropertyMap, timeout float64,
	preview bool,
) (resource.ID, resource.PropertyMap, resource.Status, error)

func (*Provider) Delete

func (prov *Provider) Delete(urn resource.URN,
	id resource.ID, oldInputs, oldOutputs resource.PropertyMap, timeout float64,
) (resource.Status, error)

func (*Provider) Diff

func (prov *Provider) Diff(urn resource.URN, id resource.ID,
	oldInputs, oldOutputs, newInputs resource.PropertyMap, _ bool, ignoreChanges []string,
) (plugin.DiffResult, error)

func (*Provider) DiffConfig

func (prov *Provider) DiffConfig(urn resource.URN, oldInputs, oldOutputs, newInputs resource.PropertyMap, _ bool,
	ignoreChanges []string,
) (plugin.DiffResult, error)

func (*Provider) GetMapping added in v3.49.0

func (prov *Provider) GetMapping(key, provider string) ([]byte, string, error)

func (*Provider) GetMappings added in v3.85.0

func (prov *Provider) GetMappings(key string) ([]string, error)

func (*Provider) GetPluginInfo

func (prov *Provider) GetPluginInfo() (workspace.PluginInfo, error)

func (*Provider) GetSchema

func (prov *Provider) GetSchema(version int) ([]byte, error)

func (*Provider) Invoke

func (*Provider) Pkg

func (prov *Provider) Pkg() tokens.Package

func (*Provider) Read

func (prov *Provider) Read(urn resource.URN, id resource.ID,
	inputs, state resource.PropertyMap,
) (plugin.ReadResult, resource.Status, error)

func (*Provider) SignalCancellation

func (prov *Provider) SignalCancellation() error

func (*Provider) StreamInvoke

func (prov *Provider) StreamInvoke(
	tok tokens.ModuleMember, args resource.PropertyMap,
	onNext func(resource.PropertyMap) error,
) ([]plugin.CheckFailure, error)

func (*Provider) Update

func (prov *Provider) Update(urn resource.URN, id resource.ID, oldInputs, oldOutputs, newInputs resource.PropertyMap,
	timeout float64, ignoreChanges []string, preview bool,
) (resource.PropertyMap, resource.Status, error)

type ProviderLoader

type ProviderLoader = PluginLoader

func NewProviderLoader

func NewProviderLoader(pkg tokens.Package, version semver.Version, load LoadProviderFunc,
	opts ...ProviderOption,
) *ProviderLoader

func NewProviderLoaderWithHost

func NewProviderLoaderWithHost(pkg tokens.Package, version semver.Version,
	load LoadProviderWithHostFunc, opts ...ProviderOption,
) *ProviderLoader

type ProviderOption

type ProviderOption = PluginOption

type RegisterResourceResponse added in v3.113.3

type RegisterResourceResponse struct {
	URN          resource.URN
	ID           resource.ID
	Outputs      resource.PropertyMap
	Dependencies map[resource.PropertyKey][]resource.URN
	Result       pulumirpc.Result
}

type ResourceMonitor

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

func NewResourceMonitor

func NewResourceMonitor(resmon pulumirpc.ResourceMonitorClient) *ResourceMonitor

func (*ResourceMonitor) Call added in v3.7.0

func (*ResourceMonitor) Close

func (rm *ResourceMonitor) Close() error

func (*ResourceMonitor) Invoke

func (*ResourceMonitor) ReadResource

func (rm *ResourceMonitor) ReadResource(t tokens.Type, name string, id resource.ID, parent resource.URN,
	inputs resource.PropertyMap, provider, version, sourcePosition string,
) (resource.URN, resource.PropertyMap, error)

func (*ResourceMonitor) RegisterResource

func (rm *ResourceMonitor) RegisterResource(t tokens.Type, name string, custom bool,
	options ...ResourceOptions,
) (*RegisterResourceResponse, error)

func (*ResourceMonitor) RegisterResourceOutputs

func (rm *ResourceMonitor) RegisterResourceOutputs(urn resource.URN, outputs resource.PropertyMap) error

func (*ResourceMonitor) RegisterStackTransform added in v3.107.0

func (rm *ResourceMonitor) RegisterStackTransform(callback *pulumirpc.Callback) error

type ResourceOptions

type ResourceOptions struct {
	Parent                  resource.URN
	Protect                 bool
	Dependencies            []resource.URN
	Provider                string
	Inputs                  resource.PropertyMap
	PropertyDeps            map[resource.PropertyKey][]resource.URN
	DeleteBeforeReplace     *bool
	Version                 string
	PluginDownloadURL       string
	PluginChecksums         map[string][]byte
	IgnoreChanges           []string
	ReplaceOnChanges        []string
	AliasURNs               []resource.URN
	Aliases                 []*pulumirpc.Alias
	ImportID                resource.ID
	CustomTimeouts          *resource.CustomTimeouts
	RetainOnDelete          bool
	DeletedWith             resource.URN
	SupportsPartialValues   *bool
	Remote                  bool
	Providers               map[string]string
	AdditionalSecretOutputs []resource.PropertyKey
	AliasSpecs              bool

	SourcePosition            string
	DisableSecrets            bool
	DisableResourceReferences bool
	GrpcRequestHeaders        map[string]string

	Transforms []*pulumirpc.Callback

	SupportsResultReporting bool
}

Jump to

Keyboard shortcuts

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