convert

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: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapperRegistration added in v3.60.0

func MapperRegistration(m codegenrpc.MapperServer) func(*grpc.Server)

func NewMapperServer added in v3.60.0

func NewMapperServer(mapper Mapper) codegenrpc.MapperServer

Types

type Mapper

type Mapper interface {
	// Returns plugin specific mapping data for the given provider name. The "pulumiProvider" is used as a
	// hint for which pulumi plugin will provider this mapping. Returns an empty result if no mapping
	// information was available.
	GetMapping(ctx context.Context, provider string, pulumiProvider string) ([]byte, error)
}

An interface to map provider names (N.B. These aren't Pulumi provider names, but the names of "providers" in the source language being converted from) to plugin specific mapping data.

func NewMapperClient added in v3.60.0

func NewMapperClient(target string) (Mapper, error)

func NewPluginMapper

func NewPluginMapper(ws Workspace,
	providerFactory ProviderFactory,
	key string, mappings []string,
	installProvider func(tokens.Package) *semver.Version,
) (Mapper, error)

type ProviderFactory added in v3.65.0

type ProviderFactory func(tokens.Package, *semver.Version) (plugin.Provider, error)

ProviderFactory creates a provider for a given package and version.

func ProviderFactoryFromHost added in v3.65.0

func ProviderFactoryFromHost(host plugin.Host) ProviderFactory

ProviderFactoryFromHost builds a ProviderFactory that uses the given plugin host to create providers.

type Workspace added in v3.65.0

type Workspace interface {
	// GetPlugins returns the list of plugins installed in the workspace.
	GetPlugins() ([]workspace.PluginInfo, error)
}

Workspace is the current workspace. This is used to get the list of plugins installed in the workspace. It's analogous to the workspace package, but scoped down to just the parts we need.

This should probably be used to replace a load of our currently hardcoded for real world (i.e actual file system, actual http calls) plugin workspace code, but for now we're keeping it scoped just to help out with testing the mapper code.

func DefaultWorkspace added in v3.65.0

func DefaultWorkspace() Workspace

DefaultWorkspace returns a default workspace implementation that uses the workspace module directly to get plugin info.

Jump to

Keyboard shortcuts

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