Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer)
- type ConnectorConfig
- func (*ConnectorConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectorConfig) GetConfig() *structpb.Struct
- func (x *ConnectorConfig) GetSecrets() *structpb.Struct
- func (x *ConnectorConfig) GetType() string
- func (*ConnectorConfig) ProtoMessage()
- func (x *ConnectorConfig) ProtoReflect() protoreflect.Message
- func (x *ConnectorConfig) Reset()
- func (x *ConnectorConfig) String() string
- type Contributions
- func (*Contributions) Descriptor() ([]byte, []int)deprecated
- func (x *Contributions) GetActions() []string
- func (x *Contributions) GetConnectors() []string
- func (*Contributions) ProtoMessage()
- func (x *Contributions) ProtoReflect() protoreflect.Message
- func (x *Contributions) Reset()
- func (x *Contributions) String() string
- type ExecuteActionRequest
- func (*ExecuteActionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteActionRequest) GetAction() string
- func (x *ExecuteActionRequest) GetConnector() *ConnectorConfig
- func (x *ExecuteActionRequest) GetInput() *structpb.Struct
- func (*ExecuteActionRequest) ProtoMessage()
- func (x *ExecuteActionRequest) ProtoReflect() protoreflect.Message
- func (x *ExecuteActionRequest) Reset()
- func (x *ExecuteActionRequest) String() string
- type ExecuteActionResponse
- func (*ExecuteActionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteActionResponse) GetOutput() *structpb.Struct
- func (*ExecuteActionResponse) ProtoMessage()
- func (x *ExecuteActionResponse) ProtoReflect() protoreflect.Message
- func (x *ExecuteActionResponse) Reset()
- func (x *ExecuteActionResponse) String() string
- type HandshakeRequest
- type HandshakeResponse
- func (*HandshakeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HandshakeResponse) GetContributes() *Contributions
- func (x *HandshakeResponse) GetPermissions() []string
- func (x *HandshakeResponse) GetPluginId() string
- func (x *HandshakeResponse) GetPluginVersion() string
- func (x *HandshakeResponse) GetProtocolVersion() uint32
- func (*HandshakeResponse) ProtoMessage()
- func (x *HandshakeResponse) ProtoReflect() protoreflect.Message
- func (x *HandshakeResponse) Reset()
- func (x *HandshakeResponse) String() string
- type PluginServiceClient
- type PluginServiceServer
- type TestConnectorRequest
- func (*TestConnectorRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TestConnectorRequest) GetConnector() *ConnectorConfig
- func (*TestConnectorRequest) ProtoMessage()
- func (x *TestConnectorRequest) ProtoReflect() protoreflect.Message
- func (x *TestConnectorRequest) Reset()
- func (x *TestConnectorRequest) String() string
- type TestConnectorResponse
- func (*TestConnectorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TestConnectorResponse) GetMessage() string
- func (x *TestConnectorResponse) GetOk() bool
- func (*TestConnectorResponse) ProtoMessage()
- func (x *TestConnectorResponse) ProtoReflect() protoreflect.Message
- func (x *TestConnectorResponse) Reset()
- func (x *TestConnectorResponse) String() string
- type UnimplementedPluginServiceServer
- func (UnimplementedPluginServiceServer) ExecuteAction(context.Context, *ExecuteActionRequest) (*ExecuteActionResponse, error)
- func (UnimplementedPluginServiceServer) Handshake(context.Context, *HandshakeRequest) (*HandshakeResponse, error)
- func (UnimplementedPluginServiceServer) TestConnector(context.Context, *TestConnectorRequest) (*TestConnectorResponse, error)
- type UnsafePluginServiceServer
Constants ¶
const ( PluginService_Handshake_FullMethodName = "/plugin.v1.PluginService/Handshake" PluginService_ExecuteAction_FullMethodName = "/plugin.v1.PluginService/ExecuteAction" PluginService_TestConnector_FullMethodName = "/plugin.v1.PluginService/TestConnector" )
Variables ¶
var File_plugin_v1_plugin_proto protoreflect.FileDescriptor
var PluginService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "plugin.v1.PluginService", HandlerType: (*PluginServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Handshake", Handler: _PluginService_Handshake_Handler, }, { MethodName: "ExecuteAction", Handler: _PluginService_ExecuteAction_Handler, }, { MethodName: "TestConnector", Handler: _PluginService_TestConnector_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "plugin/v1/plugin.proto", }
PluginService_ServiceDesc is the grpc.ServiceDesc for PluginService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPluginServiceServer ¶
func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer)
Types ¶
type ConnectorConfig ¶
type ConnectorConfig struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Config *structpb.Struct `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
Secrets *structpb.Struct `protobuf:"bytes,3,opt,name=secrets,proto3" json:"secrets,omitempty"`
// contains filtered or unexported fields
}
ConnectorConfig carries one connector's resolved configuration and secret values, ready for a plugin to use for the duration of one action call.
func (*ConnectorConfig) Descriptor
deprecated
func (*ConnectorConfig) Descriptor() ([]byte, []int)
Deprecated: Use ConnectorConfig.ProtoReflect.Descriptor instead.
func (*ConnectorConfig) GetConfig ¶
func (x *ConnectorConfig) GetConfig() *structpb.Struct
func (*ConnectorConfig) GetSecrets ¶
func (x *ConnectorConfig) GetSecrets() *structpb.Struct
func (*ConnectorConfig) GetType ¶
func (x *ConnectorConfig) GetType() string
func (*ConnectorConfig) ProtoMessage ¶
func (*ConnectorConfig) ProtoMessage()
func (*ConnectorConfig) ProtoReflect ¶
func (x *ConnectorConfig) ProtoReflect() protoreflect.Message
func (*ConnectorConfig) Reset ¶
func (x *ConnectorConfig) Reset()
func (*ConnectorConfig) String ¶
func (x *ConnectorConfig) String() string
type Contributions ¶
type Contributions struct {
Connectors []string `protobuf:"bytes,1,rep,name=connectors,proto3" json:"connectors,omitempty"`
Actions []string `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
// contains filtered or unexported fields
}
Contributions lists the identifiers a plugin adds to the agent's registries once installed. Every entry is a stable, versioned identifier such as "postgresql.query@1".
func (*Contributions) Descriptor
deprecated
func (*Contributions) Descriptor() ([]byte, []int)
Deprecated: Use Contributions.ProtoReflect.Descriptor instead.
func (*Contributions) GetActions ¶
func (x *Contributions) GetActions() []string
func (*Contributions) GetConnectors ¶
func (x *Contributions) GetConnectors() []string
func (*Contributions) ProtoMessage ¶
func (*Contributions) ProtoMessage()
func (*Contributions) ProtoReflect ¶
func (x *Contributions) ProtoReflect() protoreflect.Message
func (*Contributions) Reset ¶
func (x *Contributions) Reset()
func (*Contributions) String ¶
func (x *Contributions) String() string
type ExecuteActionRequest ¶
type ExecuteActionRequest struct {
// The action identifier, e.g. "text.uppercase@1".
Action string `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"`
Input *structpb.Struct `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"`
// The resolved configuration and secrets of the connector the calling
// workflow step bound to this action, if any. Absent when the step bound
// no connector. Never persisted by the agent — assembled fresh for this
// one call.
Connector *ConnectorConfig `protobuf:"bytes,3,opt,name=connector,proto3" json:"connector,omitempty"`
// contains filtered or unexported fields
}
ExecuteActionRequest asks the plugin to run one action.
func (*ExecuteActionRequest) Descriptor
deprecated
func (*ExecuteActionRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteActionRequest.ProtoReflect.Descriptor instead.
func (*ExecuteActionRequest) GetAction ¶
func (x *ExecuteActionRequest) GetAction() string
func (*ExecuteActionRequest) GetConnector ¶
func (x *ExecuteActionRequest) GetConnector() *ConnectorConfig
func (*ExecuteActionRequest) GetInput ¶
func (x *ExecuteActionRequest) GetInput() *structpb.Struct
func (*ExecuteActionRequest) ProtoMessage ¶
func (*ExecuteActionRequest) ProtoMessage()
func (*ExecuteActionRequest) ProtoReflect ¶
func (x *ExecuteActionRequest) ProtoReflect() protoreflect.Message
func (*ExecuteActionRequest) Reset ¶
func (x *ExecuteActionRequest) Reset()
func (*ExecuteActionRequest) String ¶
func (x *ExecuteActionRequest) String() string
type ExecuteActionResponse ¶
type ExecuteActionResponse struct {
Output *structpb.Struct `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
// contains filtered or unexported fields
}
ExecuteActionResponse carries the action's output.
func (*ExecuteActionResponse) Descriptor
deprecated
func (*ExecuteActionResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteActionResponse.ProtoReflect.Descriptor instead.
func (*ExecuteActionResponse) GetOutput ¶
func (x *ExecuteActionResponse) GetOutput() *structpb.Struct
func (*ExecuteActionResponse) ProtoMessage ¶
func (*ExecuteActionResponse) ProtoMessage()
func (*ExecuteActionResponse) ProtoReflect ¶
func (x *ExecuteActionResponse) ProtoReflect() protoreflect.Message
func (*ExecuteActionResponse) Reset ¶
func (x *ExecuteActionResponse) Reset()
func (*ExecuteActionResponse) String ¶
func (x *ExecuteActionResponse) String() string
type HandshakeRequest ¶
type HandshakeRequest struct {
// Highest plugin protocol version the calling agent supports.
ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
// contains filtered or unexported fields
}
HandshakeRequest is sent once, immediately after the agent connects to a freshly launched plugin process.
func (*HandshakeRequest) Descriptor
deprecated
func (*HandshakeRequest) Descriptor() ([]byte, []int)
Deprecated: Use HandshakeRequest.ProtoReflect.Descriptor instead.
func (*HandshakeRequest) GetProtocolVersion ¶
func (x *HandshakeRequest) GetProtocolVersion() uint32
func (*HandshakeRequest) ProtoMessage ¶
func (*HandshakeRequest) ProtoMessage()
func (*HandshakeRequest) ProtoReflect ¶
func (x *HandshakeRequest) ProtoReflect() protoreflect.Message
func (*HandshakeRequest) Reset ¶
func (x *HandshakeRequest) Reset()
func (*HandshakeRequest) String ¶
func (x *HandshakeRequest) String() string
type HandshakeResponse ¶
type HandshakeResponse struct {
// Protocol version the plugin will speak for the rest of this session.
// Must not exceed HandshakeRequest.protocol_version; the agent rejects the
// plugin if it does.
ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
PluginId string `protobuf:"bytes,2,opt,name=plugin_id,json=pluginId,proto3" json:"plugin_id,omitempty"`
PluginVersion string `protobuf:"bytes,3,opt,name=plugin_version,json=pluginVersion,proto3" json:"plugin_version,omitempty"`
Contributes *Contributions `protobuf:"bytes,4,opt,name=contributes,proto3" json:"contributes,omitempty"`
Permissions []string `protobuf:"bytes,5,rep,name=permissions,proto3" json:"permissions,omitempty"`
// contains filtered or unexported fields
}
HandshakeResponse carries the plugin's manifest, as introduced in the vision document (section 8.3).
func (*HandshakeResponse) Descriptor
deprecated
func (*HandshakeResponse) Descriptor() ([]byte, []int)
Deprecated: Use HandshakeResponse.ProtoReflect.Descriptor instead.
func (*HandshakeResponse) GetContributes ¶
func (x *HandshakeResponse) GetContributes() *Contributions
func (*HandshakeResponse) GetPermissions ¶
func (x *HandshakeResponse) GetPermissions() []string
func (*HandshakeResponse) GetPluginId ¶
func (x *HandshakeResponse) GetPluginId() string
func (*HandshakeResponse) GetPluginVersion ¶
func (x *HandshakeResponse) GetPluginVersion() string
func (*HandshakeResponse) GetProtocolVersion ¶
func (x *HandshakeResponse) GetProtocolVersion() uint32
func (*HandshakeResponse) ProtoMessage ¶
func (*HandshakeResponse) ProtoMessage()
func (*HandshakeResponse) ProtoReflect ¶
func (x *HandshakeResponse) ProtoReflect() protoreflect.Message
func (*HandshakeResponse) Reset ¶
func (x *HandshakeResponse) Reset()
func (*HandshakeResponse) String ¶
func (x *HandshakeResponse) String() string
type PluginServiceClient ¶
type PluginServiceClient interface {
// Handshake negotiates the protocol version and returns the plugin's
// manifest: its identity, version, and the connectors/actions it
// contributes to the agent.
Handshake(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error)
// ExecuteAction runs one of the plugin's contributed actions and returns
// its output. The agent only calls this for actions listed in the
// manifest's Contributions returned by Handshake.
ExecuteAction(ctx context.Context, in *ExecuteActionRequest, opts ...grpc.CallOption) (*ExecuteActionResponse, error)
// TestConnector attempts to use a connector's resolved configuration and
// secrets to reach the external system it describes, without running any
// action. A plugin that does not support connector testing returns
// UNIMPLEMENTED; the agent surfaces that as "this plugin does not support
// connection testing", distinct from a test that ran and failed (Ok =
// false). The agent only calls this for a connector whose type is listed
// in the manifest's Contributions returned by Handshake.
TestConnector(ctx context.Context, in *TestConnectorRequest, opts ...grpc.CallOption) (*TestConnectorResponse, error)
}
PluginServiceClient is the client API for PluginService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
PluginService is implemented by every Patchcord plugin process. The agent dials it right after launching the plugin and must complete the handshake before using any of its contributions.
func NewPluginServiceClient ¶
func NewPluginServiceClient(cc grpc.ClientConnInterface) PluginServiceClient
type PluginServiceServer ¶
type PluginServiceServer interface {
// Handshake negotiates the protocol version and returns the plugin's
// manifest: its identity, version, and the connectors/actions it
// contributes to the agent.
Handshake(context.Context, *HandshakeRequest) (*HandshakeResponse, error)
// ExecuteAction runs one of the plugin's contributed actions and returns
// its output. The agent only calls this for actions listed in the
// manifest's Contributions returned by Handshake.
ExecuteAction(context.Context, *ExecuteActionRequest) (*ExecuteActionResponse, error)
// TestConnector attempts to use a connector's resolved configuration and
// secrets to reach the external system it describes, without running any
// action. A plugin that does not support connector testing returns
// UNIMPLEMENTED; the agent surfaces that as "this plugin does not support
// connection testing", distinct from a test that ran and failed (Ok =
// false). The agent only calls this for a connector whose type is listed
// in the manifest's Contributions returned by Handshake.
TestConnector(context.Context, *TestConnectorRequest) (*TestConnectorResponse, error)
// contains filtered or unexported methods
}
PluginServiceServer is the server API for PluginService service. All implementations must embed UnimplementedPluginServiceServer for forward compatibility.
PluginService is implemented by every Patchcord plugin process. The agent dials it right after launching the plugin and must complete the handshake before using any of its contributions.
type TestConnectorRequest ¶
type TestConnectorRequest struct {
Connector *ConnectorConfig `protobuf:"bytes,1,opt,name=connector,proto3" json:"connector,omitempty"`
// contains filtered or unexported fields
}
TestConnectorRequest asks the plugin to attempt a connection using one connector's resolved configuration and secrets.
func (*TestConnectorRequest) Descriptor
deprecated
func (*TestConnectorRequest) Descriptor() ([]byte, []int)
Deprecated: Use TestConnectorRequest.ProtoReflect.Descriptor instead.
func (*TestConnectorRequest) GetConnector ¶
func (x *TestConnectorRequest) GetConnector() *ConnectorConfig
func (*TestConnectorRequest) ProtoMessage ¶
func (*TestConnectorRequest) ProtoMessage()
func (*TestConnectorRequest) ProtoReflect ¶
func (x *TestConnectorRequest) ProtoReflect() protoreflect.Message
func (*TestConnectorRequest) Reset ¶
func (x *TestConnectorRequest) Reset()
func (*TestConnectorRequest) String ¶
func (x *TestConnectorRequest) String() string
type TestConnectorResponse ¶
type TestConnectorResponse struct {
Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
// Human-readable detail: the error message on failure, or empty/a short
// confirmation on success.
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
TestConnectorResponse reports the outcome of a connector test. A failed attempt (Ok = false) is a legitimate result, not an RPC error — the same distinction ExecuteActionResponse's callers already make between a business-level failure and a transport-level one.
func (*TestConnectorResponse) Descriptor
deprecated
func (*TestConnectorResponse) Descriptor() ([]byte, []int)
Deprecated: Use TestConnectorResponse.ProtoReflect.Descriptor instead.
func (*TestConnectorResponse) GetMessage ¶
func (x *TestConnectorResponse) GetMessage() string
func (*TestConnectorResponse) GetOk ¶
func (x *TestConnectorResponse) GetOk() bool
func (*TestConnectorResponse) ProtoMessage ¶
func (*TestConnectorResponse) ProtoMessage()
func (*TestConnectorResponse) ProtoReflect ¶
func (x *TestConnectorResponse) ProtoReflect() protoreflect.Message
func (*TestConnectorResponse) Reset ¶
func (x *TestConnectorResponse) Reset()
func (*TestConnectorResponse) String ¶
func (x *TestConnectorResponse) String() string
type UnimplementedPluginServiceServer ¶
type UnimplementedPluginServiceServer struct{}
UnimplementedPluginServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedPluginServiceServer) ExecuteAction ¶
func (UnimplementedPluginServiceServer) ExecuteAction(context.Context, *ExecuteActionRequest) (*ExecuteActionResponse, error)
func (UnimplementedPluginServiceServer) Handshake ¶
func (UnimplementedPluginServiceServer) Handshake(context.Context, *HandshakeRequest) (*HandshakeResponse, error)
func (UnimplementedPluginServiceServer) TestConnector ¶
func (UnimplementedPluginServiceServer) TestConnector(context.Context, *TestConnectorRequest) (*TestConnectorResponse, error)
type UnsafePluginServiceServer ¶
type UnsafePluginServiceServer interface {
// contains filtered or unexported methods
}
UnsafePluginServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PluginServiceServer will result in compilation errors.