Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapperRegistration ¶
func MapperRegistration(m codegenrpc.MapperServer) func(*grpc.Server)
func NewMapperServer ¶
func NewMapperServer(mapper Mapper) codegenrpc.MapperServer
Types ¶
type Mapper ¶
type Mapper interface { // Returns plugin specific mapping data for the given provider name. The "codeinfraProvider" is used as a // hint for which codeinfra plugin will provider this mapping. Returns an empty result if no mapping // information was available. GetMapping(ctx context.Context, provider string, codeinfraProvider string) ([]byte, error) }
An interface to map provider names (N.B. These aren't Codeinfra provider names, but the names of "providers" in the source language being converted from) to plugin specific mapping data.
func NewMapperClient ¶
type ProviderFactory ¶
ProviderFactory creates a provider for a given package and version.
func ProviderFactoryFromHost ¶
func ProviderFactoryFromHost(host plugin.Host) ProviderFactory
ProviderFactoryFromHost builds a ProviderFactory that uses the given plugin host to create providers.
type Workspace ¶
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 ¶
func DefaultWorkspace() Workspace
DefaultWorkspace returns a default workspace implementation that uses the workspace module directly to get plugin info.