{"modulePath":"github.com/newstack-cloud/bluelink/libs/plugin-framework","version":"v0.17.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pluginservicev1\n\nThis file provides adaptors for the host service to interact with the plugin service manager using the blueprint framework interfaces for providers and transformer plugins.\n\n## Constants\n\n```go\nconst (\n\t// DefaultPluginToPluginCallTimeout is the default timeout\n\t// in milliseconds for plugin to plugin calls.\n\t// This includes invoking functions, deploying resources and more.\n\tDefaultPluginToPluginCallTimeout = 120000 // 120 seconds\n\t// DefaultResourceStabilisationTimeout is the default timeout\n\t// in milliseconds for resource stabilisation when the calling plugin\n\t// requests to wait until the resource is stable.\n\tDefaultResourceStabilisationTimeout = 3600000 // 1 hour\n)\n```\n\n```go\nconst (\n\tService_Register_FullMethodName              = \"/pluginservicev1.Service/Register\"\n\tService_Deregister_FullMethodName            = \"/pluginservicev1.Service/Deregister\"\n\tService_CallFunction_FullMethodName          = \"/pluginservicev1.Service/CallFunction\"\n\tService_GetFunctionDefinition_FullMethodName = \"/pluginservicev1.Service/GetFunctionDefinition\"\n\tService_HasFunction_FullMethodName           = \"/pluginservicev1.Service/HasFunction\"\n\tService_ListFunctions_FullMethodName         = \"/pluginservicev1.Service/ListFunctions\"\n\tService_DeployResource_FullMethodName        = \"/pluginservicev1.Service/DeployResource\"\n\tService_DestroyResource_FullMethodName       = \"/pluginservicev1.Service/DestroyResource\"\n\tService_LookupResourceInState_FullMethodName = \"/pluginservicev1.Service/LookupResourceInState\"\n\tService_AcquireResourceLock_FullMethodName   = \"/pluginservicev1.Service/AcquireResourceLock\"\n\tService_ReleaseResourceLock_FullMethodName   = \"/pluginservicev1.Service/ReleaseResourceLock\"\n)\n```\n\n```go\nconst (\n\t// DefaultPort is the default TCP port for the plugin service\n\t// gRPC server.\n\tDefaultPort = 43044\n)\n```\n\n## Variables\n\n```go\nvar (\n\tPluginType_name = map[int32]string{\n\t\t0: \"PLUGIN_TYPE_NONE\",\n\t\t1: \"PLUGIN_TYPE_PROVIDER\",\n\t\t2: \"PLUGIN_TYPE_TRANSFORMER\",\n\t}\n\tPluginType_value = map[string]int32{\n\t\t\"PLUGIN_TYPE_NONE\":        0,\n\t\t\"PLUGIN_TYPE_PROVIDER\":    1,\n\t\t\"PLUGIN_TYPE_TRANSFORMER\": 2,\n\t}\n)\n```\nEnum value maps for PluginType.\n\n```go\nvar File_plugin_framework_pluginservicev1_service_proto protoreflect.FileDescriptor\n```\n\n```go\nvar Service_ServiceDesc = grpc.ServiceDesc{\n\tServiceName: \"pluginservicev1.Service\",\n\tHandlerType: (*ServiceServer)(nil),\n\tMethods: []grpc.MethodDesc{\n\t\t{\n\t\t\tMethodName: \"Register\",\n\t\t\tHandler:    _Service_Register_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"Deregister\",\n\t\t\tHandler:    _Service_Deregister_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"CallFunction\",\n\t\t\tHandler:    _Service_CallFunction_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"GetFunctionDefinition\",\n\t\t\tHandler:    _Service_GetFunctionDefinition_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"HasFunction\",\n\t\t\tHandler:    _Service_HasFunction_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"ListFunctions\",\n\t\t\tHandler:    _Service_ListFunctions_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"DeployResource\",\n\t\t\tHandler:    _Service_DeployResource_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"DestroyResource\",\n\t\t\tHandler:    _Service_DestroyResource_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"LookupResourceInState\",\n\t\t\tHandler:    _Service_LookupResourceInState_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"AcquireResourceLock\",\n\t\t\tHandler:    _Service_AcquireResourceLock_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"ReleaseResourceLock\",\n\t\t\tHandler:    _Service_ReleaseResourceLock_Handler,\n\t\t},\n\t},\n\tStreams:  []grpc.StreamDesc{},\n\tMetadata: \"plugin-framework/pluginservicev1/service.proto\",\n}\n```\nService\\_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)\n\n## Functions\n\n```go\nfunc FunctionRegistryFromClient(\n\tclient ServiceClient,\n\thostInfo pluginutils.HostInfoContainer,\n) provider.FunctionRegistry\n```\nFunctionRegistryFromClient creates a new instance of a FunctionRegistry that uses the provided ServiceClient to interact with the deploy engine. This allows plugin implementations to interact with the deploy engine using the blueprint framework interfaces abstracting away the communication protocol from plugin developers.\n\n```go\nfunc GetProviderPluginAdaptors(manager Manager) map[string]provider.Provider\n```\nGetProviderPluginAdaptors returns a map of provider adaptors that can be used by the host service to interact with registered provider plugins.\n\n```go\nfunc RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)\n```\n\n```go\nfunc ResourceServiceFromClient(\n\tclient ServiceClient,\n) provider.ResourceService\n```\nResourceServiceFromClient creates a new instance of a ResourceService that uses the provided ServiceClient to interact with the deploy engine. This allows plugin implementations to interact with the deploy engine using the blueprint framework interfaces abstracting away the communication protocol from plugin developers.\n\n## Types\n\n```go\ntype AcquireResourceLockRequest struct {\n\n\t// The ID of the blueprint instance to scope the resource lock to.\n\tInstanceId string `protobuf:\"bytes,1,opt,name=instance_id,json=instanceId\" json:\"instance_id,omitempty\"`\n\t// The name of the resource in the blueprint to lock.\n\tResourceName string `protobuf:\"bytes,2,opt,name=resource_name,json=resourceName\" json:\"resource_name,omitempty\"`\n\t// The identifier of the caller that is seeking to acquire the lock.\n\tAcquiredBy string                         `protobuf:\"bytes,3,opt,name=acquired_by,json=acquiredBy\" json:\"acquired_by,omitempty\"`\n\tContext    *sharedtypesv1.ProviderContext `protobuf:\"bytes,4,opt,name=context\" json:\"context,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nAcquireResourceLockRequest is the request to acquire a lock on a resource.\n\n```go\nfunc (*AcquireResourceLockRequest) Descriptor() ([]byte, []int)\n```\nDeprecated: Use AcquireResourceLockRequest.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *AcquireResourceLockRequest) GetAcquiredBy() string\n```\n\n```go\nfunc (x *AcquireResourceLockRequest) GetContext() *sharedtypesv1.ProviderContext\n```\n\n```go\nfunc (x *AcquireResourceLockRequest) GetInstanceId() string\n```\n\n```go\nfunc (x *AcquireResourceLockRequest) GetResourceName() string\n```\n\n```go\nfunc (*AcquireResourceLockRequest) ProtoMessage()\n```\n\n```go\nfunc (x *AcquireResourceLockRequest) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *AcquireResourceLockRequest) Reset()\n```\n\n```go\nfunc (x *AcquireResourceLockRequest) String() string\n```\n\n```go\ntype AcquireResourceLockResponse struct {\n\n\t// Types that are valid to be assigned to Response:\n\t//\n\t//\t*AcquireResourceLockResponse_Result\n\t//\t*AcquireResourceLockResponse_ErrorResponse\n\tResponse isAcquireResourceLockResponse_Response `protobuf_oneof:\"response\"`\n\t// contains filtered or unexported fields\n}\n```\nAcquireResourceLockResponse is the response containing the result of acquiring a resource lock.\n\n```go\nfunc (*AcquireResourceLockResponse) Descriptor() ([]byte, []int)\n```\nDeprecated: Use AcquireResourceLockResponse.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *AcquireResourceLockResponse) GetErrorResponse() *sharedtypesv1.ErrorResponse\n```\n\n```go\nfunc (x *AcquireResourceLockResponse) GetResponse() isAcquireResourceLockResponse_Response\n```\n\n```go\nfunc (x *AcquireResourceLockResponse) GetResult() *AcquireResourceLockResult\n```\n\n```go\nfunc (*AcquireResourceLockResponse) ProtoMessage()\n```\n\n```go\nfunc (x *AcquireResourceLockResponse) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *AcquireResourceLockResponse) Reset()\n```\n\n```go\nfunc (x *AcquireResourceLockResponse) String() string\n```\n\n```go\ntype AcquireResourceLockResponse_ErrorResponse struct {\n\tErrorResponse *sharedtypesv1.ErrorResponse `protobuf:\"bytes,2,opt,name=error_response,json=errorResponse,oneof\"`\n}\n```\n\n```go\ntype AcquireResourceLockResponse_Result struct {\n\tResult *AcquireResourceLockResult `protobuf:\"bytes,1,opt,name=result,oneof\"`\n}\n```\n\n```go\ntype AcquireResourceLockResult struct {\n\tAcquired bool `protobuf:\"varint,1,opt,name=acquired\" json:\"acquired,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nAcquireResourceLockResult contains the result of acquiring a lock to a resource.\n\n```go\nfunc (*AcquireResourceLockResult) Descriptor() ([]byte, []int)\n```\nDeprecated: Use AcquireResourceLockResult.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *AcquireResourceLockResult) GetAcquired() bool\n```\n\n```go\nfunc (*AcquireResourceLockResult) ProtoMessage()\n```\n\n```go\nfunc (x *AcquireResourceLockResult) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *AcquireResourceLockResult) Reset()\n```\n\n```go\nfunc (x *AcquireResourceLockResult) String() string\n```\n\n```go\ntype DeployResourceServiceRequest struct {\n\n\t// The deploy resource request that is used to deploy\n\t// the resource with the plugin responsible for the\n\t// resource provider.\n\tDeployRequest *sharedtypesv1.DeployResourceRequest `protobuf:\"bytes,1,opt,name=deploy_request,json=deployRequest\" json:\"deploy_request,omitempty\"`\n\t// Whether the plugin should wait for the resource to stabilise\n\t// before returning a response.\n\tWaitUntilStable bool `protobuf:\"varint,2,opt,name=wait_until_stable,json=waitUntilStable\" json:\"wait_until_stable,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nDeployResourceServiceRequest is the request used to deploy a resource from a plugin. This enhances the sharedtypesv1.DeployResourceRequest to allow for a plugin to specify whether it wants to wait for the resource to stabilise before returning a response.\n\n```go\nfunc (*DeployResourceServiceRequest) Descriptor() ([]byte, []int)\n```\nDeprecated: Use DeployResourceServiceRequest.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *DeployResourceServiceRequest) GetDeployRequest() *sharedtypesv1.DeployResourceRequest\n```\n\n```go\nfunc (x *DeployResourceServiceRequest) GetWaitUntilStable() bool\n```\n\n```go\nfunc (*DeployResourceServiceRequest) ProtoMessage()\n```\n\n```go\nfunc (x *DeployResourceServiceRequest) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *DeployResourceServiceRequest) Reset()\n```\n\n```go\nfunc (x *DeployResourceServiceRequest) String() string\n```\n\n```go\ntype FunctionCheckResult struct {\n\tHasFunction bool `protobuf:\"varint,1,opt,name=has_function,json=hasFunction\" json:\"has_function,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nFunctionCheckResult is the result of checking if a function has been registered with the deploy engine.\n\n```go\nfunc (*FunctionCheckResult) Descriptor() ([]byte, []int)\n```\nDeprecated: Use FunctionCheckResult.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *FunctionCheckResult) GetHasFunction() bool\n```\n\n```go\nfunc (*FunctionCheckResult) ProtoMessage()\n```\n\n```go\nfunc (x *FunctionCheckResult) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *FunctionCheckResult) Reset()\n```\n\n```go\nfunc (x *FunctionCheckResult) String() string\n```\n\n```go\ntype FunctionList struct {\n\tFunctions []string `protobuf:\"bytes,1,rep,name=functions\" json:\"functions,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nFunctionList is the list of functions that have been registered with the deploy engine.\n\n```go\nfunc (*FunctionList) Descriptor() ([]byte, []int)\n```\nDeprecated: Use FunctionList.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *FunctionList) GetFunctions() []string\n```\n\n```go\nfunc (*FunctionList) ProtoMessage()\n```\n\n```go\nfunc (x *FunctionList) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *FunctionList) Reset()\n```\n\n```go\nfunc (x *FunctionList) String() string\n```\n\n```go\ntype HasFunctionRequest struct {\n\tFunctionName string `protobuf:\"bytes,1,opt,name=function_name,json=functionName\" json:\"function_name,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nHasFunctionRequest is the request to check if a function has been registered with the deploy engine.\n\n```go\nfunc (*HasFunctionRequest) Descriptor() ([]byte, []int)\n```\nDeprecated: Use HasFunctionRequest.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *HasFunctionRequest) GetFunctionName() string\n```\n\n```go\nfunc (*HasFunctionRequest) ProtoMessage()\n```\n\n```go\nfunc (x *HasFunctionRequest) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *HasFunctionRequest) Reset()\n```\n\n```go\nfunc (x *HasFunctionRequest) String() string\n```\n\n```go\ntype HasFunctionResponse struct {\n\n\t// Types that are valid to be assigned to Response:\n\t//\n\t//\t*HasFunctionResponse_FunctionCheckResult\n\t//\t*HasFunctionResponse_ErrorResponse\n\tResponse isHasFunctionResponse_Response `protobuf_oneof:\"response\"`\n\t// contains filtered or unexported fields\n}\n```\nHasFunctionResponse is the response with the result of checking if a function has been registered with the deploy engine.\n\n```go\nfunc (*HasFunctionResponse) Descriptor() ([]byte, []int)\n```\nDeprecated: Use HasFunctionResponse.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *HasFunctionResponse) GetErrorResponse() *sharedtypesv1.ErrorResponse\n```\n\n```go\nfunc (x *HasFunctionResponse) GetFunctionCheckResult() *FunctionCheckResult\n```\n\n```go\nfunc (x *HasFunctionResponse) GetResponse() isHasFunctionResponse_Response\n```\n\n```go\nfunc (*HasFunctionResponse) ProtoMessage()\n```\n\n```go\nfunc (x *HasFunctionResponse) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *HasFunctionResponse) Reset()\n```\n\n```go\nfunc (x *HasFunctionResponse) String() string\n```\n\n```go\ntype HasFunctionResponse_ErrorResponse struct {\n\tErrorResponse *sharedtypesv1.ErrorResponse `protobuf:\"bytes,2,opt,name=error_response,json=errorResponse,oneof\"`\n}\n```\n\n```go\ntype HasFunctionResponse_FunctionCheckResult struct {\n\tFunctionCheckResult *FunctionCheckResult `protobuf:\"bytes,1,opt,name=function_check_result,json=functionCheckResult,oneof\"`\n}\n```\n\n```go\ntype ListFunctionsResponse struct {\n\n\t// Types that are valid to be assigned to Response:\n\t//\n\t//\t*ListFunctionsResponse_FunctionList\n\t//\t*ListFunctionsResponse_ErrorResponse\n\tResponse isListFunctionsResponse_Response `protobuf_oneof:\"response\"`\n\t// contains filtered or unexported fields\n}\n```\nListFunctionsResponse is the response with the list of functions that have been registered with the deploy engine.\n\n```go\nfunc (*ListFunctionsResponse) Descriptor() ([]byte, []int)\n```\nDeprecated: Use ListFunctionsResponse.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *ListFunctionsResponse) GetErrorResponse() *sharedtypesv1.ErrorResponse\n```\n\n```go\nfunc (x *ListFunctionsResponse) GetFunctionList() *FunctionList\n```\n\n```go\nfunc (x *ListFunctionsResponse) GetResponse() isListFunctionsResponse_Response\n```\n\n```go\nfunc (*ListFunctionsResponse) ProtoMessage()\n```\n\n```go\nfunc (x *ListFunctionsResponse) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *ListFunctionsResponse) Reset()\n```\n\n```go\nfunc (x *ListFunctionsResponse) String() string\n```\n\n```go\ntype ListFunctionsResponse_ErrorResponse struct {\n\tErrorResponse *sharedtypesv1.ErrorResponse `protobuf:\"bytes,2,opt,name=error_response,json=errorResponse,oneof\"`\n}\n```\n\n```go\ntype ListFunctionsResponse_FunctionList struct {\n\tFunctionList *FunctionList `protobuf:\"bytes,1,opt,name=function_list,json=functionList,oneof\"`\n}\n```\n\n```go\ntype LookupResourceInStateRequest struct {\n\n\t// The ID of the blueprint instance to look up the resource in.\n\tInstanceId string `protobuf:\"bytes,1,opt,name=instance_id,json=instanceId\" json:\"instance_id,omitempty\"`\n\t// The type of the resource to look up.\n\t// For eaxmple, \"aws/iam/role\" or \"gcloud/compute/instance\".\n\tResourceType string `protobuf:\"bytes,2,opt,name=resource_type,json=resourceType\" json:\"resource_type,omitempty\"`\n\t// The external identifier of the resource in the provider.\n\t// This is defined in a resource type spec definition as the\n\t// `IDField`.\n\tExternalId string                         `protobuf:\"bytes,3,opt,name=external_id,json=externalId\" json:\"external_id,omitempty\"`\n\tContext    *sharedtypesv1.ProviderContext `protobuf:\"bytes,4,opt,name=context\" json:\"context,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nLookupResourceInStateRequest is the request to look up a resource in the blueprint state.\n\n```go\nfunc (*LookupResourceInStateRequest) Descriptor() ([]byte, []int)\n```\nDeprecated: Use LookupResourceInStateRequest.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *LookupResourceInStateRequest) GetContext() *sharedtypesv1.ProviderContext\n```\n\n```go\nfunc (x *LookupResourceInStateRequest) GetExternalId() string\n```\n\n```go\nfunc (x *LookupResourceInStateRequest) GetInstanceId() string\n```\n\n```go\nfunc (x *LookupResourceInStateRequest) GetResourceType() string\n```\n\n```go\nfunc (*LookupResourceInStateRequest) ProtoMessage()\n```\n\n```go\nfunc (x *LookupResourceInStateRequest) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *LookupResourceInStateRequest) Reset()\n```\n\n```go\nfunc (x *LookupResourceInStateRequest) String() string\n```\n\n```go\ntype LookupResourceInStateResponse struct {\n\n\t// Types that are valid to be assigned to Response:\n\t//\n\t//\t*LookupResourceInStateResponse_Resource\n\t//\t*LookupResourceInStateResponse_ErrorResponse\n\tResponse isLookupResourceInStateResponse_Response `protobuf_oneof:\"response\"`\n\t// contains filtered or unexported fields\n}\n```\nLookupResourceInStateResponse is the response to the LookupResourceInStateRequest.\n\n```go\nfunc (*LookupResourceInStateResponse) Descriptor() ([]byte, []int)\n```\nDeprecated: Use LookupResourceInStateResponse.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *LookupResourceInStateResponse) GetErrorResponse() *sharedtypesv1.ErrorResponse\n```\n\n```go\nfunc (x *LookupResourceInStateResponse) GetResource() *sharedtypesv1.ResourceState\n```\n\n```go\nfunc (x *LookupResourceInStateResponse) GetResponse() isLookupResourceInStateResponse_Response\n```\n\n```go\nfunc (*LookupResourceInStateResponse) ProtoMessage()\n```\n\n```go\nfunc (x *LookupResourceInStateResponse) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *LookupResourceInStateResponse) Reset()\n```\n\n```go\nfunc (x *LookupResourceInStateResponse) String() string\n```\n\n```go\ntype LookupResourceInStateResponse_ErrorResponse struct {\n\tErrorResponse *sharedtypesv1.ErrorResponse `protobuf:\"bytes,2,opt,name=error_response,json=errorResponse,oneof\"`\n}\n```\n\n```go\ntype LookupResourceInStateResponse_Resource struct {\n\tResource *sharedtypesv1.ResourceState `protobuf:\"bytes,1,opt,name=resource,oneof\"`\n}\n```\n\n```go\ntype Manager interface {\n\t// RegisterPlugin registers a plugin with the host system\n\t// that the manager represents.\n\tRegisterPlugin(info *PluginInstanceInfo) error\n\t// DeregisterPlugin deregisters a plugin from the host system\n\t// that the manager represents.\n\tDeregisterPlugin(pluginType PluginType, id string) error\n\t// GetPlugin retrieves a plugin instance based on the plugin type\n\t// and the plugin ID.\n\tGetPlugin(pluginType PluginType, id string) *PluginInstance\n\t// GetPluginMetadata retrieves the metadata of a plugin instance\n\t// based on the plugin type and the plugin ID.\n\t// This is useful for retrieving core metadata for plugin\n\t// documentation.\n\tGetPluginMetadata(pluginType PluginType, id string) *PluginExtendedMetadata\n\t// GetPlugins retrieves all plugin instances for a given plugin type.\n\tGetPlugins(pluginType PluginType) []*PluginInstance\n\t// SetPluginProcess sets the kill function for a registered plugin's OS process.\n\t// This should be called by the launcher after a plugin has registered.\n\tSetPluginProcess(pluginType PluginType, id string, killProcess func() error)\n\t// Close terminates all plugin processes and closes their connections.\n\tClose()\n}\n```\nManager is an interface that defines the methods for registering and deregistering plugins along with retrieving plugin instances to interact with. The caller is responsible for type assertions to derive the actual client interface based on the plugin type.\n\n```go\nfunc NewManager(\n\tprotocolVersions map[PluginType]string,\n\tpluginFactory PluginFactory,\n\thostID string,\n) Manager\n```\nNewManager creates a new instance of a plugin manager that enables the deploy engine to interact with plugins and backs the \"pluginservice\" gRPC service that plugins can register with.\n\n```go\ntype PluginDeregistrationRequest struct {\n\n\t// The type of plugin that needs to be deregistered.\n\tPluginType PluginType `protobuf:\"varint,1,opt,name=plugin_type,json=pluginType,enum=pluginservicev1.PluginType\" json:\"plugin_type,omitempty\"`\n\t// The id of the plugin instance that should correspond to the\n\t// id that was captured when the plugin was launched.\n\tInstanceId string `protobuf:\"bytes,2,opt,name=instance_id,json=instanceId\" json:\"instance_id,omitempty\"`\n\t// The ID of the host that the plugin was registered with.\n\t// If the host does not match, nothing will be done.\n\tHostId string `protobuf:\"bytes,3,opt,name=host_id,json=hostId\" json:\"host_id,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nPluginDeregistrationResponse is the request for deregistering a plugin.\n\n```go\nfunc (*PluginDeregistrationRequest) Descriptor() ([]byte, []int)\n```\nDeprecated: Use PluginDeregistrationRequest.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *PluginDeregistrationRequest) GetHostId() string\n```\n\n```go\nfunc (x *PluginDeregistrationRequest) GetInstanceId() string\n```\n\n```go\nfunc (x *PluginDeregistrationRequest) GetPluginType() PluginType\n```\n\n```go\nfunc (*PluginDeregistrationRequest) ProtoMessage()\n```\n\n```go\nfunc (x *PluginDeregistrationRequest) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *PluginDeregistrationRequest) Reset()\n```\n\n```go\nfunc (x *PluginDeregistrationRequest) String() string\n```\n\n```go\ntype PluginDeregistrationResponse struct {\n\tSuccess bool   `protobuf:\"varint,1,opt,name=success\" json:\"success,omitempty\"`\n\tMessage string `protobuf:\"bytes,2,opt,name=message\" json:\"message,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nPluginDeregistrationResponse is the response for deregistering a plugin.\n\n```go\nfunc (*PluginDeregistrationResponse) Descriptor() ([]byte, []int)\n```\nDeprecated: Use PluginDeregistrationResponse.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *PluginDeregistrationResponse) GetMessage() string\n```\n\n```go\nfunc (x *PluginDeregistrationResponse) GetSuccess() bool\n```\n\n```go\nfunc (*PluginDeregistrationResponse) ProtoMessage()\n```\n\n```go\nfunc (x *PluginDeregistrationResponse) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *PluginDeregistrationResponse) Reset()\n```\n\n```go\nfunc (x *PluginDeregistrationResponse) String() string\n```\n\n```go\ntype PluginExtendedMetadata struct {\n\t// A semver version for the plugin that can be used\n\t// for documentation and debugging purposes.\n\tPluginVersion string\n\t// A friendly name for the plugin to be displayed\n\t// in documentation and user interfaces.\n\tDisplayName string\n\t// A plain text description of the plugin.\n\tPlainTextDescription string\n\t// A formatted description of the plugin\n\t// that can be formatted with markdown.\n\tFormattedDescription string\n\t// The URL of the git repository that the plugin\n\t// is hosted in.\n\tRepositoryUrl string\n\t// The company or individual that authored the plugin.\n\tAuthor string\n\t// The protocol versions that the plugin supports.\n\tProtocolVersions []string\n}\n```\nPluginExtendedMetadata holds the metadata of a plugin instance that a plugin will provide during registration along with the protocol versions that the plugin supports.\n\n```go\ntype PluginFactory func(*PluginInstanceInfo, string) (any, func(), error)\n```\n\n```go\ntype PluginInstance struct {\n\tInfo *PluginInstanceInfo\n\t// type assertions should be carried out by callers at runtime\n\t// to derive the actual client interface based on the plugin type.\n\tClient    any\n\tCloseConn func()\n\t// KillProcess terminates the OS process for this plugin.\n\t// This is set by the launcher after the plugin has registered.\n\tKillProcess func() error\n}\n```\nPluginInstance represents an instance of a plugin that has been registered with the host system.\n\n```go\ntype PluginInstanceInfo struct {\n\tPluginType PluginType\n\t// ProtocolVersions contains the protocol versions that\n\t// the plugin supports.\n\t// Currently, the only supported protocol version is \"1.0\".\n\tProtocolVersions []string\n\t// The unique identifier for the provider plugin.\n\t// In addition to being unique, the ID should point to the location\n\t// where the provider plugin can be downloaded.\n\t// {hostname/}?{namespace}/{provider}\n\t//\n\t// For example:\n\t// registry.bluelink.dev/bluelink/aws\n\t// bluelink/aws\n\t//\n\t// The last portion of the ID is the unique name of the provider\n\t// that is expected to be used as the namespace for resources, data sources\n\t// and custom variable types used in blueprints.\n\t// For example, the namespace for AWS resources is \"aws\"\n\t// used in the resource type \"aws/lambda/function\".\n\tID string\n\t// Metadata that can be used for plugin documentation.\n\tMetadata *PluginMetadata\n\t// The ID of an instance of a plugin that has been loaded\n\t// by the host system.\n\tInstanceID     string\n\tTCPPort        int\n\tUnixSocketPath string\n}\n```\nPluginInstanceInfo represents the information about a plugin instance that is registered with the host system.\n\n```go\ntype PluginMetadata struct {\n\n\t// A semver version for the plugin that can be used\n\t// for documentation and debugging purposes.\n\tPluginVersion string `protobuf:\"bytes,1,opt,name=plugin_version,json=pluginVersion\" json:\"plugin_version,omitempty\"`\n\t// A friendly name for the plugin to be displayed\n\t// in documentation and user interfaces.\n\tDisplayName string `protobuf:\"bytes,2,opt,name=display_name,json=displayName\" json:\"display_name,omitempty\"`\n\t// A plain text description of the plugin.\n\tPlainTextDescription string `protobuf:\"bytes,3,opt,name=plain_text_description,json=plainTextDescription\" json:\"plain_text_description,omitempty\"`\n\t// A formatted description of the plugin\n\t// that can be formatted with markdown.\n\tFormattedDescription string `protobuf:\"bytes,4,opt,name=formatted_description,json=formattedDescription\" json:\"formatted_description,omitempty\"`\n\t// The URL of the git repository that the plugin\n\t// is hosted in.\n\tRepositoryUrl string `protobuf:\"bytes,5,opt,name=repository_url,json=repositoryUrl\" json:\"repository_url,omitempty\"`\n\t// The company or individual that authored the plugin.\n\tAuthor string `protobuf:\"bytes,6,opt,name=author\" json:\"author,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nPluginMetadata is basic metadata for the plugin that can be used for documentation.\n\n```go\nfunc (*PluginMetadata) Descriptor() ([]byte, []int)\n```\nDeprecated: Use PluginMetadata.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *PluginMetadata) GetAuthor() string\n```\n\n```go\nfunc (x *PluginMetadata) GetDisplayName() string\n```\n\n```go\nfunc (x *PluginMetadata) GetFormattedDescription() string\n```\n\n```go\nfunc (x *PluginMetadata) GetPlainTextDescription() string\n```\n\n```go\nfunc (x *PluginMetadata) GetPluginVersion() string\n```\n\n```go\nfunc (x *PluginMetadata) GetRepositoryUrl() string\n```\n\n```go\nfunc (*PluginMetadata) ProtoMessage()\n```\n\n```go\nfunc (x *PluginMetadata) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *PluginMetadata) Reset()\n```\n\n```go\nfunc (x *PluginMetadata) String() string\n```\n\n```go\ntype PluginRegistrationRequest struct {\n\n\t// The type of plugin that is registered.\n\tPluginType PluginType `protobuf:\"varint,1,opt,name=plugin_type,json=pluginType,enum=pluginservicev1.PluginType\" json:\"plugin_type,omitempty\"`\n\t// The unique identifier for the provider plugin.\n\t// In addition to being unique, the ID should point to the location\n\t// where the provider plugin can be downloaded.\n\t// {hostname/}?{namespace}/{provider}\n\t//\n\t// For example:\n\t// registry.bluelink.dev/bluelink/aws\n\t// bluelink/aws\n\tPluginId string `protobuf:\"bytes,2,opt,name=plugin_id,json=pluginId\" json:\"plugin_id,omitempty\"`\n\t// The id of the plugin instance that should correspond to the\n\t// id that was captured when the plugin was launched.\n\tInstanceId string `protobuf:\"bytes,3,opt,name=instance_id,json=instanceId\" json:\"instance_id,omitempty\"`\n\t// The protocol versions that the plugin supports.\n\t// Each protocol version must be in the form MAJOR.MINOR,\n\t// for example: 1.0, 1.1, 2.0.\n\tProtocolVersions []string `protobuf:\"bytes,4,rep,name=protocol_versions,json=protocolVersions\" json:\"protocol_versions,omitempty\"`\n\t// Metadata for the plugin that can be used for documentation.\n\tMetadata *PluginMetadata `protobuf:\"bytes,5,opt,name=metadata\" json:\"metadata,omitempty\"`\n\t// The tcp port that the plugin is listening on.\n\t// Only the port needs to be specified here as the address\n\t// can only ever be the loopback address,\n\t// plugins can not be called from a remote host.\n\tPort int32 `protobuf:\"varint,6,opt,name=port\" json:\"port,omitempty\"`\n\t// The unix socket that the plugin is listening on.\n\tUnixSocket string `protobuf:\"bytes,7,opt,name=unix_socket,json=unixSocket\" json:\"unix_socket,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nPluginRegistrationRequest is the request for registering a plugin.\n\n```go\nfunc (*PluginRegistrationRequest) Descriptor() ([]byte, []int)\n```\nDeprecated: Use PluginRegistrationRequest.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *PluginRegistrationRequest) GetInstanceId() string\n```\n\n```go\nfunc (x *PluginRegistrationRequest) GetMetadata() *PluginMetadata\n```\n\n```go\nfunc (x *PluginRegistrationRequest) GetPluginId() string\n```\n\n```go\nfunc (x *PluginRegistrationRequest) GetPluginType() PluginType\n```\n\n```go\nfunc (x *PluginRegistrationRequest) GetPort() int32\n```\n\n```go\nfunc (x *PluginRegistrationRequest) GetProtocolVersions() []string\n```\n\n```go\nfunc (x *PluginRegistrationRequest) GetUnixSocket() string\n```\n\n```go\nfunc (*PluginRegistrationRequest) ProtoMessage()\n```\n\n```go\nfunc (x *PluginRegistrationRequest) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *PluginRegistrationRequest) Reset()\n```\n\n```go\nfunc (x *PluginRegistrationRequest) String() string\n```\n\n```go\ntype PluginRegistrationResponse struct {\n\tSuccess bool   `protobuf:\"varint,1,opt,name=success\" json:\"success,omitempty\"`\n\tMessage string `protobuf:\"bytes,2,opt,name=message\" json:\"message,omitempty\"`\n\t// The ID of the host that the plugin was registered with.\n\t// This will be checked against the host that makes requests\n\t// to the plugin.\n\tHostId string `protobuf:\"bytes,3,opt,name=host_id,json=hostId\" json:\"host_id,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nPluginRegistrationResponse is the response for registering a plugin.\n\n```go\nfunc (*PluginRegistrationResponse) Descriptor() ([]byte, []int)\n```\nDeprecated: Use PluginRegistrationResponse.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *PluginRegistrationResponse) GetHostId() string\n```\n\n```go\nfunc (x *PluginRegistrationResponse) GetMessage() string\n```\n\n```go\nfunc (x *PluginRegistrationResponse) GetSuccess() bool\n```\n\n```go\nfunc (*PluginRegistrationResponse) ProtoMessage()\n```\n\n```go\nfunc (x *PluginRegistrationResponse) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *PluginRegistrationResponse) Reset()\n```\n\n```go\nfunc (x *PluginRegistrationResponse) String() string\n```\n\n```go\ntype PluginType int32\n```\nPluginType is an enum for the type of plugin being registered. The plugin type is used to determine the type of plugin that is being registered.\n\n```go\nconst (\n\t// protobuf enums must have a zero value, so we need a NONE value\n\t// here.\n\t// PluginType starts at 1.\n\tPluginType_PLUGIN_TYPE_NONE PluginType = 0\n\t// A provider plugin.\n\tPluginType_PLUGIN_TYPE_PROVIDER PluginType = 1\n\t// A transformer plugin.\n\tPluginType_PLUGIN_TYPE_TRANSFORMER PluginType = 2\n)\n```\n\n```go\nfunc PluginTypeFromString(typeString string) PluginType\n```\nPluginTypeFromString converts a string to a PluginType. If the string is not recognized, PLUGIN\\_TYPE\\_NONE is returned.\n\n```go\nfunc (PluginType) Descriptor() protoreflect.EnumDescriptor\n```\n\n```go\nfunc (x PluginType) Enum() *PluginType\n```\n\n```go\nfunc (PluginType) EnumDescriptor() ([]byte, []int)\n```\nDeprecated: Use PluginType.Descriptor instead.\n\n```go\nfunc (x PluginType) Number() protoreflect.EnumNumber\n```\n\n```go\nfunc (x PluginType) String() string\n```\n\n```go\nfunc (PluginType) Type() protoreflect.EnumType\n```\n\n```go\ntype ReleaseResourceLockRequest struct {\n\n\t// The ID of the blueprint instance the lock is scoped to.\n\tInstanceId string `protobuf:\"bytes,1,opt,name=instance_id,json=instanceId\" json:\"instance_id,omitempty\"`\n\t// The name of the resource in the blueprint to release.\n\tResourceName string `protobuf:\"bytes,2,opt,name=resource_name,json=resourceName\" json:\"resource_name,omitempty\"`\n\t// The identifier of the caller that holds the lock. A lock recorded under any\n\t// other caller is left alone.\n\tAcquiredBy string                         `protobuf:\"bytes,3,opt,name=acquired_by,json=acquiredBy\" json:\"acquired_by,omitempty\"`\n\tContext    *sharedtypesv1.ProviderContext `protobuf:\"bytes,4,opt,name=context\" json:\"context,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nReleaseResourceLockRequest is the request to release a lock on a resource.\n\n```go\nfunc (*ReleaseResourceLockRequest) Descriptor() ([]byte, []int)\n```\nDeprecated: Use ReleaseResourceLockRequest.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *ReleaseResourceLockRequest) GetAcquiredBy() string\n```\n\n```go\nfunc (x *ReleaseResourceLockRequest) GetContext() *sharedtypesv1.ProviderContext\n```\n\n```go\nfunc (x *ReleaseResourceLockRequest) GetInstanceId() string\n```\n\n```go\nfunc (x *ReleaseResourceLockRequest) GetResourceName() string\n```\n\n```go\nfunc (*ReleaseResourceLockRequest) ProtoMessage()\n```\n\n```go\nfunc (x *ReleaseResourceLockRequest) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *ReleaseResourceLockRequest) Reset()\n```\n\n```go\nfunc (x *ReleaseResourceLockRequest) String() string\n```\n\n```go\ntype ReleaseResourceLockResponse struct {\n\n\t// Types that are valid to be assigned to Response:\n\t//\n\t//\t*ReleaseResourceLockResponse_Result\n\t//\t*ReleaseResourceLockResponse_ErrorResponse\n\tResponse isReleaseResourceLockResponse_Response `protobuf_oneof:\"response\"`\n\t// contains filtered or unexported fields\n}\n```\nReleaseResourceLockResponse is the response containing the result of releasing a resource lock.\n\n```go\nfunc (*ReleaseResourceLockResponse) Descriptor() ([]byte, []int)\n```\nDeprecated: Use ReleaseResourceLockResponse.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *ReleaseResourceLockResponse) GetErrorResponse() *sharedtypesv1.ErrorResponse\n```\n\n```go\nfunc (x *ReleaseResourceLockResponse) GetResponse() isReleaseResourceLockResponse_Response\n```\n\n```go\nfunc (x *ReleaseResourceLockResponse) GetResult() *ReleaseResourceLockResult\n```\n\n```go\nfunc (*ReleaseResourceLockResponse) ProtoMessage()\n```\n\n```go\nfunc (x *ReleaseResourceLockResponse) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *ReleaseResourceLockResponse) Reset()\n```\n\n```go\nfunc (x *ReleaseResourceLockResponse) String() string\n```\n\n```go\ntype ReleaseResourceLockResponse_ErrorResponse struct {\n\tErrorResponse *sharedtypesv1.ErrorResponse `protobuf:\"bytes,2,opt,name=error_response,json=errorResponse,oneof\"`\n}\n```\n\n```go\ntype ReleaseResourceLockResponse_Result struct {\n\tResult *ReleaseResourceLockResult `protobuf:\"bytes,1,opt,name=result,oneof\"`\n}\n```\n\n```go\ntype ReleaseResourceLockResult struct {\n\n\t// Whether a lock held by the caller was released. False when there was\n\t// nothing to release, which is not a failure.\n\tReleased bool `protobuf:\"varint,1,opt,name=released\" json:\"released,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nReleaseResourceLockResult contains the result of releasing a lock on a resource.\n\n```go\nfunc (*ReleaseResourceLockResult) Descriptor() ([]byte, []int)\n```\nDeprecated: Use ReleaseResourceLockResult.ProtoReflect.Descriptor instead.\n\n```go\nfunc (x *ReleaseResourceLockResult) GetReleased() bool\n```\n\n```go\nfunc (*ReleaseResourceLockResult) ProtoMessage()\n```\n\n```go\nfunc (x *ReleaseResourceLockResult) ProtoReflect() protoreflect.Message\n```\n\n```go\nfunc (x *ReleaseResourceLockResult) Reset()\n```\n\n```go\nfunc (x *ReleaseResourceLockResult) String() string\n```\n\n```go\ntype Server struct {\n\t// contains filtered or unexported fields\n}\n```\nServer for the plugin service that manages registration and deregistration of plugins and allows plugins to make calls to a subset of functionality provided by other plugins.\n\n```go\nfunc NewServer(\n\tpluginService ServiceServer,\n\topts ...ServerOption,\n) *Server\n```\n\n```go\nfunc (s *Server) Serve() (func(), error)\n```\n\n```go\ntype ServerOption func(*Server)\n```\nServerOption is a function that configures a server.\n\n```go\nfunc WithDebug() ServerOption\n```\nWithDebug is a server option that enables debug mode.\n\n```go\nfunc WithListener(listener net.Listener) ServerOption\n```\nWithListener is a server option that sets the listener that the server should use.\n\n```go\nfunc WithTCPPort(port int) ServerOption\n```\nWithTCPPort is a server option that sets the TCP port.\n\n```go\nfunc WithUnixSocket(path string) ServerOption\n```\nWithUnixSocket is a server option that sets the Unix socket path.\n\n```go\ntype ServiceClient interface {\n\t// Register is used by plugins to register themselves\n\t// with the deploy engine.\n\tRegister(ctx context.Context, in *PluginRegistrationRequest, opts ...grpc.CallOption) (*PluginRegistrationResponse, error)\n\t// Deregister is used by plugins to deregister themselves\n\t// from the deploy engine.\n\tDeregister(ctx context.Context, in *PluginDeregistrationRequest, opts ...grpc.CallOption) (*PluginDeregistrationResponse, error)\n\t// CallFunction is used to allow plugins to call functions\n\t// that have been registered with the deploy engine.\n\t// Only functions can call other functions, this behaviour is\n\t// essential to allow for function composition in blueprints.\n\tCallFunction(ctx context.Context, in *sharedtypesv1.FunctionCallRequest, opts ...grpc.CallOption) (*sharedtypesv1.FunctionCallResponse, error)\n\t// GetFunctionDefinition is used to get the definition of a function\n\t// that has been registered with the deploy engine.\n\tGetFunctionDefinition(ctx context.Context, in *sharedtypesv1.FunctionDefinitionRequest, opts ...grpc.CallOption) (*sharedtypesv1.FunctionDefinitionResponse, error)\n\t// HasFunction is used to check if a function has been registered\n\t// with the deploy engine.\n\tHasFunction(ctx context.Context, in *HasFunctionRequest, opts ...grpc.CallOption) (*HasFunctionResponse, error)\n\t// ListFunctions is used to list all the functions that have been\n\t// registered with the deploy engine.\n\tListFunctions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListFunctionsResponse, error)\n\t// DeployResource deals with deploying a resource with the upstream resource provider.\n\t// THe behaviour of deploy is to create or update the resource configuration and return\n\t// the resource spec state once the configuration has been created or updated.\n\t// The caller is responsible for making sure that the input resource spec is valid.\n\t// The `wait_until_stable` field can be used to determine whether the service should wait for the\n\t// resource to stabilise before returning a response.\n\t// This is meant to be used to reuse resource plugins to manage intermediary resources\n\t// in a link implementation, this must not be used for managing resources that are explicitly\n\t// defined in a blueprint.\n\tDeployResource(ctx context.Context, in *DeployResourceServiceRequest, opts ...grpc.CallOption) (*sharedtypesv1.DeployResourceResponse, error)\n\t// DestroyResource deals with destroying a resource instance if its current\n\t// state is successfully deployed or cleaning up a corrupt or partially deployed\n\t// resource instance.\n\t// The resource instance should be completely removed from the external provider\n\t// as a result of this operation.\n\t// This is meant to be used to reuse resource plugins to manage intermediary resources\n\t// in a link implementation, this must not be used for managing resources that are explicitly\n\t// defined in a blueprint.\n\tDestroyResource(ctx context.Context, in *sharedtypesv1.DestroyResourceRequest, opts ...grpc.CallOption) (*sharedtypesv1.DestroyResourceResponse, error)\n\t// LookupResourceInState retrieves a resource of a given type from the blueprint\n\t// state.\n\t// This is meant to be used to allow link implementations to check if intermediary resources\n\t// are present in the blueprint state, when the intermediary resource should already exist\n\t// in the blueprint instance so the link can update the resource without impacting drift\n\t// detection as only links in the same blueprint instance that modify resources are taken into\n\t// account for drift detection.\n\tLookupResourceInState(ctx context.Context, in *LookupResourceInStateRequest, opts ...grpc.CallOption) (*LookupResourceInStateResponse, error)\n\t// AcquireResourceLock acquires a lock on a resource of a given type\n\t// in the blueprint state to ensure that no other operations\n\t// are modifying the resource at the same time.\n\t// This is useful for links that need to update existing resources\n\t// in the same blueprint as a part of the intermediary resources update phase.\n\t// The blueprint container releases the lock when the phase that acquired it\n\t// finishes, including when the link update fails, and attributes it to the link\n\t// that took it so the release matches. A held lock is never taken from its holder:\n\t// a caller that cannot acquire one within the lock timeout fails with an error\n\t// naming the holder rather than proceeding without it.\n\tAcquireResourceLock(ctx context.Context, in *AcquireResourceLockRequest, opts ...grpc.CallOption) (*AcquireResourceLockResponse, error)\n\t// ReleaseResourceLock releases a lock the caller holds, without waiting for the\n\t// phase that took it to finish.\n\t//\n\t// A lock is otherwise held to the end of the phase, which suits a phase that is\n\t// wholly about the locked resource. It suits a phase that goes on to do slow and\n\t// unrelated work far less: everyone else wanting that resource waits for work\n\t// that has nothing to do with it. A link that grants an execution role access and\n\t// then reconciles networking is the case this exists for.\n\t//\n\t// Releasing a lock the caller does not hold is not an error, and never disturbs\n\t// the holder.\n\tReleaseResourceLock(ctx context.Context, in *ReleaseResourceLockRequest, opts ...grpc.CallOption) (*ReleaseResourceLockResponse, error)\n}\n```\nServiceClient is the client API for Service service.\n\nFor semantics around ctx use and closing/ending streaming RPCs, please refer to [https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream](https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream).\n\nInterface exported by the deploy engine to allow plugins to register and deregister themselves along with inter-plugin communication.\n\n```go\nfunc NewEnvServiceClient() (ServiceClient, func(), error)\n```\nNewEnvServiceClient creates a new plugin service client from the current environment.\n\n```go\nfunc NewServiceClient(cc grpc.ClientConnInterface) ServiceClient\n```\n\n```go\ntype ServiceServer interface {\n\t// Register is used by plugins to register themselves\n\t// with the deploy engine.\n\tRegister(context.Context, *PluginRegistrationRequest) (*PluginRegistrationResponse, error)\n\t// Deregister is used by plugins to deregister themselves\n\t// from the deploy engine.\n\tDeregister(context.Context, *PluginDeregistrationRequest) (*PluginDeregistrationResponse, error)\n\t// CallFunction is used to allow plugins to call functions\n\t// that have been registered with the deploy engine.\n\t// Only functions can call other functions, this behaviour is\n\t// essential to allow for function composition in blueprints.\n\tCallFunction(context.Context, *sharedtypesv1.FunctionCallRequest) (*sharedtypesv1.FunctionCallResponse, error)\n\t// GetFunctionDefinition is used to get the definition of a function\n\t// that has been registered with the deploy engine.\n\tGetFunctionDefinition(context.Context, *sharedtypesv1.FunctionDefinitionRequest) (*sharedtypesv1.FunctionDefinitionResponse, error)\n\t// HasFunction is used to check if a function has been registered\n\t// with the deploy engine.\n\tHasFunction(context.Context, *HasFunctionRequest) (*HasFunctionResponse, error)\n\t// ListFunctions is used to list all the functions that have been\n\t// registered with the deploy engine.\n\tListFunctions(context.Context, *emptypb.Empty) (*ListFunctionsResponse, error)\n\t// DeployResource deals with deploying a resource with the upstream resource provider.\n\t// THe behaviour of deploy is to create or update the resource configuration and return\n\t// the resource spec state once the configuration has been created or updated.\n\t// The caller is responsible for making sure that the input resource spec is valid.\n\t// The `wait_until_stable` field can be used to determine whether the service should wait for the\n\t// resource to stabilise before returning a response.\n\t// This is meant to be used to reuse resource plugins to manage intermediary resources\n\t// in a link implementation, this must not be used for managing resources that are explicitly\n\t// defined in a blueprint.\n\tDeployResource(context.Context, *DeployResourceServiceRequest) (*sharedtypesv1.DeployResourceResponse, error)\n\t// DestroyResource deals with destroying a resource instance if its current\n\t// state is successfully deployed or cleaning up a corrupt or partially deployed\n\t// resource instance.\n\t// The resource instance should be completely removed from the external provider\n\t// as a result of this operation.\n\t// This is meant to be used to reuse resource plugins to manage intermediary resources\n\t// in a link implementation, this must not be used for managing resources that are explicitly\n\t// defined in a blueprint.\n\tDestroyResource(context.Context, *sharedtypesv1.DestroyResourceRequest) (*sharedtypesv1.DestroyResourceResponse, error)\n\t// LookupResourceInState retrieves a resource of a given type from the blueprint\n\t// state.\n\t// This is meant to be used to allow link implementations to check if intermediary resources\n\t// are present in the blueprint state, when the intermediary resource should already exist\n\t// in the blueprint instance so the link can update the resource without impacting drift\n\t// detection as only links in the same blueprint instance that modify resources are taken into\n\t// account for drift detection.\n\tLookupResourceInState(context.Context, *LookupResourceInStateRequest) (*LookupResourceInStateResponse, error)\n\t// AcquireResourceLock acquires a lock on a resource of a given type\n\t// in the blueprint state to ensure that no other operations\n\t// are modifying the resource at the same time.\n\t// This is useful for links that need to update existing resources\n\t// in the same blueprint as a part of the intermediary resources update phase.\n\t// The blueprint container releases the lock when the phase that acquired it\n\t// finishes, including when the link update fails, and attributes it to the link\n\t// that took it so the release matches. A held lock is never taken from its holder:\n\t// a caller that cannot acquire one within the lock timeout fails with an error\n\t// naming the holder rather than proceeding without it.\n\tAcquireResourceLock(context.Context, *AcquireResourceLockRequest) (*AcquireResourceLockResponse, error)\n\t// ReleaseResourceLock releases a lock the caller holds, without waiting for the\n\t// phase that took it to finish.\n\t//\n\t// A lock is otherwise held to the end of the phase, which suits a phase that is\n\t// wholly about the locked resource. It suits a phase that goes on to do slow and\n\t// unrelated work far less: everyone else wanting that resource waits for work\n\t// that has nothing to do with it. A link that grants an execution role access and\n\t// then reconciles networking is the case this exists for.\n\t//\n\t// Releasing a lock the caller does not hold is not an error, and never disturbs\n\t// the holder.\n\tReleaseResourceLock(context.Context, *ReleaseResourceLockRequest) (*ReleaseResourceLockResponse, error)\n\t// contains filtered or unexported methods\n}\n```\nServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility.\n\nInterface exported by the deploy engine to allow plugins to register and deregister themselves along with inter-plugin communication.\n\n```go\nfunc NewServiceServer(\n\tpluginManager Manager,\n\tfunctionRegistry provider.FunctionRegistry,\n\tresourceService provider.ResourceService,\n\thostID string,\n\topts ...ServiceServerOption,\n) ServiceServer\n```\nNewServiceServer creates a new gRPC server for the plugin service that manages registration and deregistration of plugins along with allowing a subset of plugin functionality to make calls to other plugins.\n\n```go\ntype ServiceServerOption func(*pluginServiceServer)\n```\nServiceServerOption is a function that configures a service server.\n\n```go\nfunc WithPluginToPluginCallTimeout(timeout int) ServiceServerOption\n```\nWithPluginToPluginCallTimeout is a service server option that sets the timeout in milliseconds for plugin to plugin calls. This covers the case where a provider or transformer plugin uses the plugin service to invoke functions or deploy resources as these actions will call plugins.\n\nWhen not provided, the default timeout is 120 seconds.\n\n```go\nfunc WithResourceStabilisationTimeout(timeout int) ServiceServerOption\n```\nWithResourceStabilisationTimeout is a service server option that sets the timeout in milliseconds for resource stabilisation when the calling plugin request to wait until the resource is stable. This is used instead of the plugin to plugin call timeout as the plugin to plugin call timeout is generally a short period of time (e.g. 10 seconds) and certain kinds of resources may take a long time to stabilise.\n\nWhen not provided, the default resource stabilisation timeout is 3,600,000ms (1 hour).\n\n```go\ntype UnimplementedServiceServer struct{}\n```\nUnimplementedServiceServer must be embedded to have forward compatible implementations.\n\nNOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.\n\n```go\nfunc (UnimplementedServiceServer) AcquireResourceLock(context.Context, *AcquireResourceLockRequest) (*AcquireResourceLockResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) CallFunction(context.Context, *sharedtypesv1.FunctionCallRequest) (*sharedtypesv1.FunctionCallResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) DeployResource(context.Context, *DeployResourceServiceRequest) (*sharedtypesv1.DeployResourceResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) Deregister(context.Context, *PluginDeregistrationRequest) (*PluginDeregistrationResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) DestroyResource(context.Context, *sharedtypesv1.DestroyResourceRequest) (*sharedtypesv1.DestroyResourceResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) GetFunctionDefinition(context.Context, *sharedtypesv1.FunctionDefinitionRequest) (*sharedtypesv1.FunctionDefinitionResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) HasFunction(context.Context, *HasFunctionRequest) (*HasFunctionResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) ListFunctions(context.Context, *emptypb.Empty) (*ListFunctionsResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) LookupResourceInState(context.Context, *LookupResourceInStateRequest) (*LookupResourceInStateResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) Register(context.Context, *PluginRegistrationRequest) (*PluginRegistrationResponse, error)\n```\n\n```go\nfunc (UnimplementedServiceServer) ReleaseResourceLock(context.Context, *ReleaseResourceLockRequest) (*ReleaseResourceLockResponse, error)\n```\n\n```go\ntype UnsafeServiceServer interface {\n\t// contains filtered or unexported methods\n}\n```\nUnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.\n\n","path":"github.com/newstack-cloud/bluelink/libs/plugin-framework/pluginservicev1","name":"pluginservicev1","synopsis":"This file provides adaptors for the host service to interact with the plugin service manager using the blueprint framework interfaces for providers and transformer plugins.","isRedistributable":true}
