Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterToolPluginServer(s grpc.ServiceRegistrar, srv ToolPluginServer)
- type CallRequest
- func (*CallRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CallRequest) GetPayload() string
- func (x *CallRequest) GetToolName() string
- func (*CallRequest) ProtoMessage()
- func (x *CallRequest) ProtoReflect() protoreflect.Message
- func (x *CallRequest) Reset()
- func (x *CallRequest) String() string
- type CallResponse
- type ConfigureRequest
- func (*ConfigureRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ConfigureRequest) GetSettings() map[string]string
- func (*ConfigureRequest) ProtoMessage()
- func (x *ConfigureRequest) ProtoReflect() protoreflect.Message
- func (x *ConfigureRequest) Reset()
- func (x *ConfigureRequest) String() string
- type ConfigureResponse
- func (*ConfigureResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ConfigureResponse) GetError() string
- func (x *ConfigureResponse) GetSuccess() bool
- func (*ConfigureResponse) ProtoMessage()
- func (x *ConfigureResponse) ProtoReflect() protoreflect.Message
- func (x *ConfigureResponse) Reset()
- func (x *ConfigureResponse) String() string
- type GetToolInfoRequest
- func (*GetToolInfoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetToolInfoRequest) GetToolName() string
- func (*GetToolInfoRequest) ProtoMessage()
- func (x *GetToolInfoRequest) ProtoReflect() protoreflect.Message
- func (x *GetToolInfoRequest) Reset()
- func (x *GetToolInfoRequest) String() string
- type GetToolInfoResponse
- func (*GetToolInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetToolInfoResponse) GetTool() *ToolInfo
- func (*GetToolInfoResponse) ProtoMessage()
- func (x *GetToolInfoResponse) ProtoReflect() protoreflect.Message
- func (x *GetToolInfoResponse) Reset()
- func (x *GetToolInfoResponse) String() string
- type ListToolsRequest
- type ListToolsResponse
- func (*ListToolsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListToolsResponse) GetTools() []*ToolInfo
- func (*ListToolsResponse) ProtoMessage()
- func (x *ListToolsResponse) ProtoReflect() protoreflect.Message
- func (x *ListToolsResponse) Reset()
- func (x *ListToolsResponse) String() string
- type ToolInfo
- func (*ToolInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ToolInfo) GetDescription() string
- func (x *ToolInfo) GetName() string
- func (x *ToolInfo) GetSchemaJson() string
- func (*ToolInfo) ProtoMessage()
- func (x *ToolInfo) ProtoReflect() protoreflect.Message
- func (x *ToolInfo) Reset()
- func (x *ToolInfo) String() string
- type ToolPluginClient
- type ToolPluginServer
- type UnimplementedToolPluginServer
- func (UnimplementedToolPluginServer) Call(context.Context, *CallRequest) (*CallResponse, error)
- func (UnimplementedToolPluginServer) Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error)
- func (UnimplementedToolPluginServer) GetToolInfo(context.Context, *GetToolInfoRequest) (*GetToolInfoResponse, error)
- func (UnimplementedToolPluginServer) ListTools(context.Context, *ListToolsRequest) (*ListToolsResponse, error)
- type UnsafeToolPluginServer
Constants ¶
const ( ToolPlugin_Configure_FullMethodName = "/plugin.ToolPlugin/Configure" ToolPlugin_Call_FullMethodName = "/plugin.ToolPlugin/Call" ToolPlugin_GetToolInfo_FullMethodName = "/plugin.ToolPlugin/GetToolInfo" ToolPlugin_ListTools_FullMethodName = "/plugin.ToolPlugin/ListTools" )
Variables ¶
var File_proto_plugin_proto protoreflect.FileDescriptor
var ToolPlugin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "plugin.ToolPlugin", HandlerType: (*ToolPluginServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Configure", Handler: _ToolPlugin_Configure_Handler, }, { MethodName: "Call", Handler: _ToolPlugin_Call_Handler, }, { MethodName: "GetToolInfo", Handler: _ToolPlugin_GetToolInfo_Handler, }, { MethodName: "ListTools", Handler: _ToolPlugin_ListTools_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/plugin.proto", }
ToolPlugin_ServiceDesc is the grpc.ServiceDesc for ToolPlugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterToolPluginServer ¶
func RegisterToolPluginServer(s grpc.ServiceRegistrar, srv ToolPluginServer)
Types ¶
type CallRequest ¶
type CallRequest struct {
ToolName string `protobuf:"bytes,1,opt,name=tool_name,json=toolName,proto3" json:"tool_name,omitempty"`
Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*CallRequest) Descriptor
deprecated
func (*CallRequest) Descriptor() ([]byte, []int)
Deprecated: Use CallRequest.ProtoReflect.Descriptor instead.
func (*CallRequest) GetPayload ¶
func (x *CallRequest) GetPayload() string
func (*CallRequest) GetToolName ¶
func (x *CallRequest) GetToolName() string
func (*CallRequest) ProtoMessage ¶
func (*CallRequest) ProtoMessage()
func (*CallRequest) ProtoReflect ¶
func (x *CallRequest) ProtoReflect() protoreflect.Message
func (*CallRequest) Reset ¶
func (x *CallRequest) Reset()
func (*CallRequest) String ¶
func (x *CallRequest) String() string
type CallResponse ¶
type CallResponse struct {
Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
// contains filtered or unexported fields
}
func (*CallResponse) Descriptor
deprecated
func (*CallResponse) Descriptor() ([]byte, []int)
Deprecated: Use CallResponse.ProtoReflect.Descriptor instead.
func (*CallResponse) GetResult ¶
func (x *CallResponse) GetResult() string
func (*CallResponse) ProtoMessage ¶
func (*CallResponse) ProtoMessage()
func (*CallResponse) ProtoReflect ¶
func (x *CallResponse) ProtoReflect() protoreflect.Message
func (*CallResponse) Reset ¶
func (x *CallResponse) Reset()
func (*CallResponse) String ¶
func (x *CallResponse) String() string
type ConfigureRequest ¶
type ConfigureRequest struct {
Settings map[string]string `` /* 143-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*ConfigureRequest) Descriptor
deprecated
func (*ConfigureRequest) Descriptor() ([]byte, []int)
Deprecated: Use ConfigureRequest.ProtoReflect.Descriptor instead.
func (*ConfigureRequest) GetSettings ¶
func (x *ConfigureRequest) GetSettings() map[string]string
func (*ConfigureRequest) ProtoMessage ¶
func (*ConfigureRequest) ProtoMessage()
func (*ConfigureRequest) ProtoReflect ¶
func (x *ConfigureRequest) ProtoReflect() protoreflect.Message
func (*ConfigureRequest) Reset ¶
func (x *ConfigureRequest) Reset()
func (*ConfigureRequest) String ¶
func (x *ConfigureRequest) String() string
type ConfigureResponse ¶
type ConfigureResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*ConfigureResponse) Descriptor
deprecated
func (*ConfigureResponse) Descriptor() ([]byte, []int)
Deprecated: Use ConfigureResponse.ProtoReflect.Descriptor instead.
func (*ConfigureResponse) GetError ¶
func (x *ConfigureResponse) GetError() string
func (*ConfigureResponse) GetSuccess ¶
func (x *ConfigureResponse) GetSuccess() bool
func (*ConfigureResponse) ProtoMessage ¶
func (*ConfigureResponse) ProtoMessage()
func (*ConfigureResponse) ProtoReflect ¶
func (x *ConfigureResponse) ProtoReflect() protoreflect.Message
func (*ConfigureResponse) Reset ¶
func (x *ConfigureResponse) Reset()
func (*ConfigureResponse) String ¶
func (x *ConfigureResponse) String() string
type GetToolInfoRequest ¶
type GetToolInfoRequest struct {
ToolName string `protobuf:"bytes,1,opt,name=tool_name,json=toolName,proto3" json:"tool_name,omitempty"`
// contains filtered or unexported fields
}
func (*GetToolInfoRequest) Descriptor
deprecated
func (*GetToolInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetToolInfoRequest.ProtoReflect.Descriptor instead.
func (*GetToolInfoRequest) GetToolName ¶
func (x *GetToolInfoRequest) GetToolName() string
func (*GetToolInfoRequest) ProtoMessage ¶
func (*GetToolInfoRequest) ProtoMessage()
func (*GetToolInfoRequest) ProtoReflect ¶
func (x *GetToolInfoRequest) ProtoReflect() protoreflect.Message
func (*GetToolInfoRequest) Reset ¶
func (x *GetToolInfoRequest) Reset()
func (*GetToolInfoRequest) String ¶
func (x *GetToolInfoRequest) String() string
type GetToolInfoResponse ¶
type GetToolInfoResponse struct {
Tool *ToolInfo `protobuf:"bytes,1,opt,name=tool,proto3" json:"tool,omitempty"`
// contains filtered or unexported fields
}
func (*GetToolInfoResponse) Descriptor
deprecated
func (*GetToolInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetToolInfoResponse.ProtoReflect.Descriptor instead.
func (*GetToolInfoResponse) GetTool ¶
func (x *GetToolInfoResponse) GetTool() *ToolInfo
func (*GetToolInfoResponse) ProtoMessage ¶
func (*GetToolInfoResponse) ProtoMessage()
func (*GetToolInfoResponse) ProtoReflect ¶
func (x *GetToolInfoResponse) ProtoReflect() protoreflect.Message
func (*GetToolInfoResponse) Reset ¶
func (x *GetToolInfoResponse) Reset()
func (*GetToolInfoResponse) String ¶
func (x *GetToolInfoResponse) String() string
type ListToolsRequest ¶
type ListToolsRequest struct {
// contains filtered or unexported fields
}
func (*ListToolsRequest) Descriptor
deprecated
func (*ListToolsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListToolsRequest.ProtoReflect.Descriptor instead.
func (*ListToolsRequest) ProtoMessage ¶
func (*ListToolsRequest) ProtoMessage()
func (*ListToolsRequest) ProtoReflect ¶
func (x *ListToolsRequest) ProtoReflect() protoreflect.Message
func (*ListToolsRequest) Reset ¶
func (x *ListToolsRequest) Reset()
func (*ListToolsRequest) String ¶
func (x *ListToolsRequest) String() string
type ListToolsResponse ¶
type ListToolsResponse struct {
Tools []*ToolInfo `protobuf:"bytes,1,rep,name=tools,proto3" json:"tools,omitempty"`
// contains filtered or unexported fields
}
func (*ListToolsResponse) Descriptor
deprecated
func (*ListToolsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListToolsResponse.ProtoReflect.Descriptor instead.
func (*ListToolsResponse) GetTools ¶
func (x *ListToolsResponse) GetTools() []*ToolInfo
func (*ListToolsResponse) ProtoMessage ¶
func (*ListToolsResponse) ProtoMessage()
func (*ListToolsResponse) ProtoReflect ¶
func (x *ListToolsResponse) ProtoReflect() protoreflect.Message
func (*ListToolsResponse) Reset ¶
func (x *ListToolsResponse) Reset()
func (*ListToolsResponse) String ¶
func (x *ListToolsResponse) String() string
type ToolInfo ¶
type ToolInfo struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
SchemaJson string `protobuf:"bytes,3,opt,name=schema_json,json=schemaJson,proto3" json:"schema_json,omitempty"` // JSON schema for the tool's input parameters
// contains filtered or unexported fields
}
ToolInfo contains the metadata for a tool
func (*ToolInfo) Descriptor
deprecated
func (*ToolInfo) GetDescription ¶
func (*ToolInfo) GetSchemaJson ¶
func (*ToolInfo) ProtoMessage ¶
func (*ToolInfo) ProtoMessage()
func (*ToolInfo) ProtoReflect ¶
func (x *ToolInfo) ProtoReflect() protoreflect.Message
type ToolPluginClient ¶
type ToolPluginClient interface {
// Configure passes plugin settings from HCL config
Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*ConfigureResponse, error)
// Call invokes a tool on the plugin with the given payload
Call(ctx context.Context, in *CallRequest, opts ...grpc.CallOption) (*CallResponse, error)
// GetToolInfo returns metadata about a specific tool
GetToolInfo(ctx context.Context, in *GetToolInfoRequest, opts ...grpc.CallOption) (*GetToolInfoResponse, error)
// ListTools returns info for all tools this plugin provides
ListTools(ctx context.Context, in *ListToolsRequest, opts ...grpc.CallOption) (*ListToolsResponse, error)
}
ToolPluginClient is the client API for ToolPlugin 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.
ToolPlugin is the service that all tool plugins must implement
func NewToolPluginClient ¶
func NewToolPluginClient(cc grpc.ClientConnInterface) ToolPluginClient
type ToolPluginServer ¶
type ToolPluginServer interface {
// Configure passes plugin settings from HCL config
Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error)
// Call invokes a tool on the plugin with the given payload
Call(context.Context, *CallRequest) (*CallResponse, error)
// GetToolInfo returns metadata about a specific tool
GetToolInfo(context.Context, *GetToolInfoRequest) (*GetToolInfoResponse, error)
// ListTools returns info for all tools this plugin provides
ListTools(context.Context, *ListToolsRequest) (*ListToolsResponse, error)
// contains filtered or unexported methods
}
ToolPluginServer is the server API for ToolPlugin service. All implementations must embed UnimplementedToolPluginServer for forward compatibility.
ToolPlugin is the service that all tool plugins must implement
type UnimplementedToolPluginServer ¶
type UnimplementedToolPluginServer struct{}
UnimplementedToolPluginServer 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 (UnimplementedToolPluginServer) Call ¶
func (UnimplementedToolPluginServer) Call(context.Context, *CallRequest) (*CallResponse, error)
func (UnimplementedToolPluginServer) Configure ¶
func (UnimplementedToolPluginServer) Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error)
func (UnimplementedToolPluginServer) GetToolInfo ¶
func (UnimplementedToolPluginServer) GetToolInfo(context.Context, *GetToolInfoRequest) (*GetToolInfoResponse, error)
func (UnimplementedToolPluginServer) ListTools ¶
func (UnimplementedToolPluginServer) ListTools(context.Context, *ListToolsRequest) (*ListToolsResponse, error)
type UnsafeToolPluginServer ¶
type UnsafeToolPluginServer interface {
// contains filtered or unexported methods
}
UnsafeToolPluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ToolPluginServer will result in compilation errors.