Documentation ¶
Overview ¶
Package provider contains logic for setting up RPC connections to provider plugins.
Index ¶
- func ComponentMain(name, version string, schema []byte, construct provider.ConstructFunc) error
- func Main(name string, ...) error
- func MainWithOptions(opts Options) error
- type HostClient
- func (host *HostClient) Close() error
- func (host *HostClient) EngineConn() *grpc.ClientConn
- func (host *HostClient) Log(context context.Context, sev diag.Severity, urn resource.URN, msg string) error
- func (host *HostClient) LogStatus(context context.Context, sev diag.Severity, urn resource.URN, msg string) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentMain ¶
func ComponentMain(name, version string, schema []byte, construct provider.ConstructFunc) error
ComponentMain is an entrypoint for a resource provider plugin that implements `Construct` for component resources. Using it isn't required but can cut down significantly on the amount of boilerplate necessary to fire up a new resource provider for components.
func Main ¶
func Main(name string, provMaker func(*HostClient) (codeinfrarpc.ResourceProviderServer, error)) error
Main is the typical entrypoint for a resource provider plugin. Using it isn't required but can cut down significantly on the amount of boilerplate necessary to fire up a new resource provider.
func MainWithOptions ¶
MainWithOptions is an entrypoint for a resource provider plugin that implements `Construct` and optionally also `Call` for component resources.
Using it isn't required but can cut down significantly on the amount of boilerplate necessary to fire up a new resource provider for components.
Types ¶
type HostClient ¶
type HostClient struct {
// contains filtered or unexported fields
}
HostClient is a client interface into the host's engine RPC interface.
func NewHostClient ¶
func NewHostClient(addr string) (*HostClient, error)
NewHostClient dials the target address, connects over gRPC, and returns a client interface.
func (*HostClient) Close ¶
func (host *HostClient) Close() error
Close closes and renders the connection and client unusable.
func (*HostClient) EngineConn ¶
func (host *HostClient) EngineConn() *grpc.ClientConn
EngineConn provides the engine gRPC client connection.
func (*HostClient) Log ¶
func (host *HostClient) Log( context context.Context, sev diag.Severity, urn resource.URN, msg string, ) error
Log logs a global message, including errors and warnings.
func (*HostClient) LogStatus ¶
func (host *HostClient) LogStatus( context context.Context, sev diag.Severity, urn resource.URN, msg string, ) error
LogStatus logs a global status message, including errors and warnings. Status messages will appear in the `Info` column of the progress display, but not in the final output.