providers

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadPluginBinary

func DownloadPluginBinary(name, version string) (string, error)

func GetDebugProvidersEnv

func GetDebugProvidersEnv(runningProviders map[ProviderName]Port) string

GetDebugProvidersEnv returns a comma-separated list of provider names and ports in the format expected by the PULUMI_DEBUG_PROVIDERS environment variable.

func NewProviderInterceptProxy added in v0.0.6

func NewProviderInterceptProxy(ctx context.Context, downstreamProviderPort Port, interceptors ProviderInterceptors) (rpc.ResourceProviderServer, error)

NewProviderInterceptProxy creates a new provider proxy that can be used to intercept calls to a downstream provider.

func NewProviderMock added in v0.0.8

func NewProviderMock(mocks ProviderMocks) (rpc.ResourceProviderServer, error)

NewProviderMock creates a new provider proxy that can be used to intercept calls to a downstream provider.

func StartProviders

func StartProviders(ctx context.Context, factories map[ProviderName]ProviderFactory, pt PulumiTest) (map[ProviderName]Port, error)

StartProviders starts each of the given providers and returns a map of provider names to the ports they are listening on. The context should be cancelled when the test is complete to shut down the providers.

Types

type Port

type Port int

Port is the port that a provider is listening on.

type ProviderFactory

type ProviderFactory func(ctx context.Context, pt PulumiTest) (Port, error)

ProviderFactory is a function that starts a provider and returns the port it is listening on. The function should return an error if the provider fails to start. When the test is complete, the context will be cancelled and the provider should exit.

func DownloadPluginBinaryFactory

func DownloadPluginBinaryFactory(name, version string) ProviderFactory

func LocalBinary

func LocalBinary(name, path string) ProviderFactory

func ProviderInterceptFactory added in v0.0.6

func ProviderInterceptFactory(ctx context.Context, factory ProviderFactory, interceptors ProviderInterceptors) ProviderFactory

ProviderInterceptFactory creates a new provider factory that can be used to intercept calls to a downstream provider.

func ProviderMockFactory added in v0.0.8

func ProviderMockFactory(mocks ProviderMocks) ProviderFactory

ProviderInterceptFactory creates a new provider factory that can be used to intercept calls to a downstream provider.

func ResourceProviderFactory

func ResourceProviderFactory(makeResourceProviderServer ResourceProviderServerFactory) ProviderFactory

startProvider starts the provider in a goProc and returns the port it's listening on. To shut down the provider, cancel the context.

type ProviderInterceptors added in v0.0.6

type ProviderInterceptors struct {
	Attach        func(ctx context.Context, in *rpc.PluginAttach, client rpc.ResourceProviderClient) (*emptypb.Empty, error)
	Call          func(ctx context.Context, in *rpc.CallRequest, client rpc.ResourceProviderClient) (*rpc.CallResponse, error)
	Cancel        func(ctx context.Context, in *emptypb.Empty, client rpc.ResourceProviderClient) (*emptypb.Empty, error)
	Check         func(ctx context.Context, in *rpc.CheckRequest, client rpc.ResourceProviderClient) (*rpc.CheckResponse, error)
	CheckConfig   func(ctx context.Context, in *rpc.CheckRequest, client rpc.ResourceProviderClient) (*rpc.CheckResponse, error)
	Configure     func(ctx context.Context, in *rpc.ConfigureRequest, client rpc.ResourceProviderClient) (*rpc.ConfigureResponse, error)
	Construct     func(ctx context.Context, in *rpc.ConstructRequest, client rpc.ResourceProviderClient) (*rpc.ConstructResponse, error)
	Create        func(ctx context.Context, in *rpc.CreateRequest, client rpc.ResourceProviderClient) (*rpc.CreateResponse, error)
	Delete        func(ctx context.Context, in *rpc.DeleteRequest, client rpc.ResourceProviderClient) (*emptypb.Empty, error)
	Diff          func(ctx context.Context, in *rpc.DiffRequest, client rpc.ResourceProviderClient) (*rpc.DiffResponse, error)
	DiffConfig    func(ctx context.Context, in *rpc.DiffRequest, client rpc.ResourceProviderClient) (*rpc.DiffResponse, error)
	GetMapping    func(ctx context.Context, in *rpc.GetMappingRequest, client rpc.ResourceProviderClient) (*rpc.GetMappingResponse, error)
	GetMappings   func(ctx context.Context, in *rpc.GetMappingsRequest, client rpc.ResourceProviderClient) (*rpc.GetMappingsResponse, error)
	GetPluginInfo func(ctx context.Context, in *emptypb.Empty, client rpc.ResourceProviderClient) (*rpc.PluginInfo, error)
	GetSchema     func(ctx context.Context, in *rpc.GetSchemaRequest, client rpc.ResourceProviderClient) (*rpc.GetSchemaResponse, error)
	Invoke        func(ctx context.Context, in *rpc.InvokeRequest, client rpc.ResourceProviderClient) (*rpc.InvokeResponse, error)
	Read          func(ctx context.Context, in *rpc.ReadRequest, client rpc.ResourceProviderClient) (*rpc.ReadResponse, error)
	Update        func(ctx context.Context, in *rpc.UpdateRequest, client rpc.ResourceProviderClient) (*rpc.UpdateResponse, error)
}

type ProviderMocks added in v0.0.8

type ProviderMocks struct {
	Attach        func(ctx context.Context, in *rpc.PluginAttach) (*emptypb.Empty, error)
	Call          func(ctx context.Context, in *rpc.CallRequest) (*rpc.CallResponse, error)
	Cancel        func(ctx context.Context, in *emptypb.Empty) (*emptypb.Empty, error)
	Check         func(ctx context.Context, in *rpc.CheckRequest) (*rpc.CheckResponse, error)
	CheckConfig   func(ctx context.Context, in *rpc.CheckRequest) (*rpc.CheckResponse, error)
	Configure     func(ctx context.Context, in *rpc.ConfigureRequest) (*rpc.ConfigureResponse, error)
	Construct     func(ctx context.Context, in *rpc.ConstructRequest) (*rpc.ConstructResponse, error)
	Create        func(ctx context.Context, in *rpc.CreateRequest) (*rpc.CreateResponse, error)
	Delete        func(ctx context.Context, in *rpc.DeleteRequest) (*emptypb.Empty, error)
	Diff          func(ctx context.Context, in *rpc.DiffRequest) (*rpc.DiffResponse, error)
	DiffConfig    func(ctx context.Context, in *rpc.DiffRequest) (*rpc.DiffResponse, error)
	GetMapping    func(ctx context.Context, in *rpc.GetMappingRequest) (*rpc.GetMappingResponse, error)
	GetMappings   func(ctx context.Context, in *rpc.GetMappingsRequest) (*rpc.GetMappingsResponse, error)
	GetPluginInfo func(ctx context.Context, in *emptypb.Empty) (*rpc.PluginInfo, error)
	GetSchema     func(ctx context.Context, in *rpc.GetSchemaRequest) (*rpc.GetSchemaResponse, error)
	Invoke        func(ctx context.Context, in *rpc.InvokeRequest) (*rpc.InvokeResponse, error)
	Read          func(ctx context.Context, in *rpc.ReadRequest) (*rpc.ReadResponse, error)
	Update        func(ctx context.Context, in *rpc.UpdateRequest) (*rpc.UpdateResponse, error)
}

type ProviderName

type ProviderName string

ProviderName is the name of a provider without the "pulumi-" prefix. e.g. "aws" or "azure"

type PulumiTest added in v0.0.11

type PulumiTest interface {
	// Source returns the current source directory.
	Source() string
}

PulumiTest provides context about the program under test.

type ResourceProviderServerFactory

type ResourceProviderServerFactory func(PulumiTest) (pulumirpc.ResourceProviderServer, error)

Jump to

Keyboard shortcuts

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