feat(messaging): run Telegram as an archipelago channel extension (#1399)
The bundled internal/channels/telegram package (17 files) is deleted; the channel now ships as archipelago/channels/telegram, launched by archiemessaging through the existing channel-extension machinery. An existing [chat.telegram] config enables it with the same keys: the token stays a secret reference (token_ref) the host resolves, allowed_user_ids and show_tool_calls map onto extension settings. Per-org bots compose the same extension per org from the org's credential binding. Reload support is now derived from a channels.Reloader interface instead of a *telegram.Gateway assertion. The five host-only seams (/update, release announcements, running versions, in-place show_tool_calls, reload) are dropped from the channel and need a contract home or deletion.
This commit is contained in:
10 files changed
+2115
-276
No files matched your search
+487
-276
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,382 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: gateway/v1/task_tools.proto
|
||||
|
||||
package gatewayv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ListTaskToolsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
RunCredential string `protobuf:"bytes,1,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListTaskToolsRequest) Reset() {
|
||||
*x = ListTaskToolsRequest{}
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListTaskToolsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListTaskToolsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListTaskToolsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListTaskToolsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListTaskToolsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ListTaskToolsRequest) GetRunCredential() string {
|
||||
if x != nil {
|
||||
return x.RunCredential
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListTaskToolsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ToolsJson []byte `protobuf:"bytes,1,opt,name=tools_json,json=toolsJson,proto3" json:"tools_json,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListTaskToolsResponse) Reset() {
|
||||
*x = ListTaskToolsResponse{}
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListTaskToolsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListTaskToolsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListTaskToolsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListTaskToolsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListTaskToolsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ListTaskToolsResponse) GetToolsJson() []byte {
|
||||
if x != nil {
|
||||
return x.ToolsJson
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CallTaskToolRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
RunCredential string `protobuf:"bytes,1,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
ArgumentsJson []byte `protobuf:"bytes,3,opt,name=arguments_json,json=argumentsJson,proto3" json:"arguments_json,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CallTaskToolRequest) Reset() {
|
||||
*x = CallTaskToolRequest{}
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CallTaskToolRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CallTaskToolRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CallTaskToolRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CallTaskToolRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CallTaskToolRequest) Descriptor() ([]byte, []int) {
|
||||
return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *CallTaskToolRequest) GetRunCredential() string {
|
||||
if x != nil {
|
||||
return x.RunCredential
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CallTaskToolRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CallTaskToolRequest) GetArgumentsJson() []byte {
|
||||
if x != nil {
|
||||
return x.ArgumentsJson
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CallTaskToolResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ResultJson []byte `protobuf:"bytes,1,opt,name=result_json,json=resultJson,proto3" json:"result_json,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CallTaskToolResponse) Reset() {
|
||||
*x = CallTaskToolResponse{}
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CallTaskToolResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CallTaskToolResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CallTaskToolResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CallTaskToolResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CallTaskToolResponse) Descriptor() ([]byte, []int) {
|
||||
return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *CallTaskToolResponse) GetResultJson() []byte {
|
||||
if x != nil {
|
||||
return x.ResultJson
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CloseTaskToolsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
RunCredential string `protobuf:"bytes,1,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CloseTaskToolsRequest) Reset() {
|
||||
*x = CloseTaskToolsRequest{}
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CloseTaskToolsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CloseTaskToolsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CloseTaskToolsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CloseTaskToolsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CloseTaskToolsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *CloseTaskToolsRequest) GetRunCredential() string {
|
||||
if x != nil {
|
||||
return x.RunCredential
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CloseTaskToolsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CloseTaskToolsResponse) Reset() {
|
||||
*x = CloseTaskToolsResponse{}
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CloseTaskToolsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CloseTaskToolsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CloseTaskToolsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_gateway_v1_task_tools_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CloseTaskToolsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CloseTaskToolsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_gateway_v1_task_tools_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
var File_gateway_v1_task_tools_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_gateway_v1_task_tools_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x1bgateway/v1/task_tools.proto\x12\n" +
|
||||
"gateway.v1\"=\n" +
|
||||
"\x14ListTaskToolsRequest\x12%\n" +
|
||||
"\x0erun_credential\x18\x01 \x01(\tR\rrunCredential\"6\n" +
|
||||
"\x15ListTaskToolsResponse\x12\x1d\n" +
|
||||
"\n" +
|
||||
"tools_json\x18\x01 \x01(\fR\ttoolsJson\"w\n" +
|
||||
"\x13CallTaskToolRequest\x12%\n" +
|
||||
"\x0erun_credential\x18\x01 \x01(\tR\rrunCredential\x12\x12\n" +
|
||||
"\x04name\x18\x02 \x01(\tR\x04name\x12%\n" +
|
||||
"\x0earguments_json\x18\x03 \x01(\fR\rargumentsJson\"7\n" +
|
||||
"\x14CallTaskToolResponse\x12\x1f\n" +
|
||||
"\vresult_json\x18\x01 \x01(\fR\n" +
|
||||
"resultJson\">\n" +
|
||||
"\x15CloseTaskToolsRequest\x12%\n" +
|
||||
"\x0erun_credential\x18\x01 \x01(\tR\rrunCredential\"\x18\n" +
|
||||
"\x16CloseTaskToolsResponse2\x94\x02\n" +
|
||||
"\x10TaskToolsService\x12T\n" +
|
||||
"\rListTaskTools\x12 .gateway.v1.ListTaskToolsRequest\x1a!.gateway.v1.ListTaskToolsResponse\x12Q\n" +
|
||||
"\fCallTaskTool\x12\x1f.gateway.v1.CallTaskToolRequest\x1a .gateway.v1.CallTaskToolResponse\x12W\n" +
|
||||
"\x0eCloseTaskTools\x12!.gateway.v1.CloseTaskToolsRequest\x1a\".gateway.v1.CloseTaskToolsResponseB\xa7\x01\n" +
|
||||
"\x0ecom.gateway.v1B\x0eTaskToolsProtoP\x01Z<github.com/samcharles93/archipelago/sdk/gateway/v1;gatewayv1\xa2\x02\x03GXX\xaa\x02\n" +
|
||||
"Gateway.V1\xca\x02\n" +
|
||||
"Gateway\\V1\xe2\x02\x16Gateway\\V1\\GPBMetadata\xea\x02\vGateway::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_gateway_v1_task_tools_proto_rawDescOnce sync.Once
|
||||
file_gateway_v1_task_tools_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_gateway_v1_task_tools_proto_rawDescGZIP() []byte {
|
||||
file_gateway_v1_task_tools_proto_rawDescOnce.Do(func() {
|
||||
file_gateway_v1_task_tools_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_gateway_v1_task_tools_proto_rawDesc), len(file_gateway_v1_task_tools_proto_rawDesc)))
|
||||
})
|
||||
return file_gateway_v1_task_tools_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_gateway_v1_task_tools_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_gateway_v1_task_tools_proto_goTypes = []any{
|
||||
(*ListTaskToolsRequest)(nil), // 0: gateway.v1.ListTaskToolsRequest
|
||||
(*ListTaskToolsResponse)(nil), // 1: gateway.v1.ListTaskToolsResponse
|
||||
(*CallTaskToolRequest)(nil), // 2: gateway.v1.CallTaskToolRequest
|
||||
(*CallTaskToolResponse)(nil), // 3: gateway.v1.CallTaskToolResponse
|
||||
(*CloseTaskToolsRequest)(nil), // 4: gateway.v1.CloseTaskToolsRequest
|
||||
(*CloseTaskToolsResponse)(nil), // 5: gateway.v1.CloseTaskToolsResponse
|
||||
}
|
||||
var file_gateway_v1_task_tools_proto_depIdxs = []int32{
|
||||
0, // 0: gateway.v1.TaskToolsService.ListTaskTools:input_type -> gateway.v1.ListTaskToolsRequest
|
||||
2, // 1: gateway.v1.TaskToolsService.CallTaskTool:input_type -> gateway.v1.CallTaskToolRequest
|
||||
4, // 2: gateway.v1.TaskToolsService.CloseTaskTools:input_type -> gateway.v1.CloseTaskToolsRequest
|
||||
1, // 3: gateway.v1.TaskToolsService.ListTaskTools:output_type -> gateway.v1.ListTaskToolsResponse
|
||||
3, // 4: gateway.v1.TaskToolsService.CallTaskTool:output_type -> gateway.v1.CallTaskToolResponse
|
||||
5, // 5: gateway.v1.TaskToolsService.CloseTaskTools:output_type -> gateway.v1.CloseTaskToolsResponse
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_gateway_v1_task_tools_proto_init() }
|
||||
func file_gateway_v1_task_tools_proto_init() {
|
||||
if File_gateway_v1_task_tools_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_gateway_v1_task_tools_proto_rawDesc), len(file_gateway_v1_task_tools_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_gateway_v1_task_tools_proto_goTypes,
|
||||
DependencyIndexes: file_gateway_v1_task_tools_proto_depIdxs,
|
||||
MessageInfos: file_gateway_v1_task_tools_proto_msgTypes,
|
||||
}.Build()
|
||||
File_gateway_v1_task_tools_proto = out.File
|
||||
file_gateway_v1_task_tools_proto_goTypes = nil
|
||||
file_gateway_v1_task_tools_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: gateway/v1/task_tools.proto
|
||||
|
||||
package gatewayv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
TaskToolsService_ListTaskTools_FullMethodName = "/gateway.v1.TaskToolsService/ListTaskTools"
|
||||
TaskToolsService_CallTaskTool_FullMethodName = "/gateway.v1.TaskToolsService/CallTaskTool"
|
||||
TaskToolsService_CloseTaskTools_FullMethodName = "/gateway.v1.TaskToolsService/CloseTaskTools"
|
||||
)
|
||||
|
||||
// TaskToolsServiceClient is the client API for TaskToolsService 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.
|
||||
//
|
||||
// TaskToolsService executes central tools for a live task grant. Only the
|
||||
// daemon calls it; identities, orgs and permissions are resolved by the server.
|
||||
type TaskToolsServiceClient interface {
|
||||
ListTaskTools(ctx context.Context, in *ListTaskToolsRequest, opts ...grpc.CallOption) (*ListTaskToolsResponse, error)
|
||||
CallTaskTool(ctx context.Context, in *CallTaskToolRequest, opts ...grpc.CallOption) (*CallTaskToolResponse, error)
|
||||
CloseTaskTools(ctx context.Context, in *CloseTaskToolsRequest, opts ...grpc.CallOption) (*CloseTaskToolsResponse, error)
|
||||
}
|
||||
|
||||
type taskToolsServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTaskToolsServiceClient(cc grpc.ClientConnInterface) TaskToolsServiceClient {
|
||||
return &taskToolsServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskToolsServiceClient) ListTaskTools(ctx context.Context, in *ListTaskToolsRequest, opts ...grpc.CallOption) (*ListTaskToolsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListTaskToolsResponse)
|
||||
err := c.cc.Invoke(ctx, TaskToolsService_ListTaskTools_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskToolsServiceClient) CallTaskTool(ctx context.Context, in *CallTaskToolRequest, opts ...grpc.CallOption) (*CallTaskToolResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CallTaskToolResponse)
|
||||
err := c.cc.Invoke(ctx, TaskToolsService_CallTaskTool_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskToolsServiceClient) CloseTaskTools(ctx context.Context, in *CloseTaskToolsRequest, opts ...grpc.CallOption) (*CloseTaskToolsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloseTaskToolsResponse)
|
||||
err := c.cc.Invoke(ctx, TaskToolsService_CloseTaskTools_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TaskToolsServiceServer is the server API for TaskToolsService service.
|
||||
// All implementations must embed UnimplementedTaskToolsServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// TaskToolsService executes central tools for a live task grant. Only the
|
||||
// daemon calls it; identities, orgs and permissions are resolved by the server.
|
||||
type TaskToolsServiceServer interface {
|
||||
ListTaskTools(context.Context, *ListTaskToolsRequest) (*ListTaskToolsResponse, error)
|
||||
CallTaskTool(context.Context, *CallTaskToolRequest) (*CallTaskToolResponse, error)
|
||||
CloseTaskTools(context.Context, *CloseTaskToolsRequest) (*CloseTaskToolsResponse, error)
|
||||
mustEmbedUnimplementedTaskToolsServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskToolsServiceServer 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.
|
||||
type UnimplementedTaskToolsServiceServer struct{}
|
||||
|
||||
func (UnimplementedTaskToolsServiceServer) ListTaskTools(context.Context, *ListTaskToolsRequest) (*ListTaskToolsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListTaskTools not implemented")
|
||||
}
|
||||
func (UnimplementedTaskToolsServiceServer) CallTaskTool(context.Context, *CallTaskToolRequest) (*CallTaskToolResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CallTaskTool not implemented")
|
||||
}
|
||||
func (UnimplementedTaskToolsServiceServer) CloseTaskTools(context.Context, *CloseTaskToolsRequest) (*CloseTaskToolsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CloseTaskTools not implemented")
|
||||
}
|
||||
func (UnimplementedTaskToolsServiceServer) mustEmbedUnimplementedTaskToolsServiceServer() {}
|
||||
func (UnimplementedTaskToolsServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTaskToolsServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskToolsServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTaskToolsServiceServer interface {
|
||||
mustEmbedUnimplementedTaskToolsServiceServer()
|
||||
}
|
||||
|
||||
func RegisterTaskToolsServiceServer(s grpc.ServiceRegistrar, srv TaskToolsServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedTaskToolsServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&TaskToolsService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _TaskToolsService_ListTaskTools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListTaskToolsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskToolsServiceServer).ListTaskTools(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskToolsService_ListTaskTools_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskToolsServiceServer).ListTaskTools(ctx, req.(*ListTaskToolsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskToolsService_CallTaskTool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CallTaskToolRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskToolsServiceServer).CallTaskTool(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskToolsService_CallTaskTool_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskToolsServiceServer).CallTaskTool(ctx, req.(*CallTaskToolRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskToolsService_CloseTaskTools_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CloseTaskToolsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskToolsServiceServer).CloseTaskTools(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskToolsService_CloseTaskTools_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskToolsServiceServer).CloseTaskTools(ctx, req.(*CloseTaskToolsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// TaskToolsService_ServiceDesc is the grpc.ServiceDesc for TaskToolsService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var TaskToolsService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "gateway.v1.TaskToolsService",
|
||||
HandlerType: (*TaskToolsServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListTaskTools",
|
||||
Handler: _TaskToolsService_ListTaskTools_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CallTaskTool",
|
||||
Handler: _TaskToolsService_CallTaskTool_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CloseTaskTools",
|
||||
Handler: _TaskToolsService_CloseTaskTools_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "gateway/v1/task_tools.proto",
|
||||
}
|
||||
Reference in new issue
Block a user