// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 // protoc (unknown) // source: botlink/v1/botlink.proto // Package scrabble.botlink.v1 is the reverse control channel between a remote // Telegram bot and the gateway. The bot dials the gateway and opens a single // long-lived Link stream (mTLS); once the stream is open the gateway pushes send // Commands down it and the bot returns one Ack per command. This keeps the bot // egress (the Bot API token, getUpdates long-poll and sendMessage) off the main // host with no inbound port on the bot. See docs/ARCHITECTURE.md. package botlinkv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" v1 "scrabble/pkg/proto/telegram/v1" 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) ) // FromBot is a message the bot sends to the gateway: the opening Hello, then one // Ack per Command. type FromBot struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Msg: // // *FromBot_Hello // *FromBot_Ack Msg isFromBot_Msg `protobuf_oneof:"msg"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FromBot) Reset() { *x = FromBot{} mi := &file_botlink_v1_botlink_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FromBot) String() string { return protoimpl.X.MessageStringOf(x) } func (*FromBot) ProtoMessage() {} func (x *FromBot) ProtoReflect() protoreflect.Message { mi := &file_botlink_v1_botlink_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 FromBot.ProtoReflect.Descriptor instead. func (*FromBot) Descriptor() ([]byte, []int) { return file_botlink_v1_botlink_proto_rawDescGZIP(), []int{0} } func (x *FromBot) GetMsg() isFromBot_Msg { if x != nil { return x.Msg } return nil } func (x *FromBot) GetHello() *Hello { if x != nil { if x, ok := x.Msg.(*FromBot_Hello); ok { return x.Hello } } return nil } func (x *FromBot) GetAck() *Ack { if x != nil { if x, ok := x.Msg.(*FromBot_Ack); ok { return x.Ack } } return nil } type isFromBot_Msg interface { isFromBot_Msg() } type FromBot_Hello struct { Hello *Hello `protobuf:"bytes,1,opt,name=hello,proto3,oneof"` } type FromBot_Ack struct { Ack *Ack `protobuf:"bytes,2,opt,name=ack,proto3,oneof"` } func (*FromBot_Hello) isFromBot_Msg() {} func (*FromBot_Ack) isFromBot_Msg() {} // ToBot is a message the gateway sends to the bot. Only Command is carried today. type ToBot struct { state protoimpl.MessageState `protogen:"open.v1"` Command *Command `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ToBot) Reset() { *x = ToBot{} mi := &file_botlink_v1_botlink_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *ToBot) String() string { return protoimpl.X.MessageStringOf(x) } func (*ToBot) ProtoMessage() {} func (x *ToBot) ProtoReflect() protoreflect.Message { mi := &file_botlink_v1_botlink_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 ToBot.ProtoReflect.Descriptor instead. func (*ToBot) Descriptor() ([]byte, []int) { return file_botlink_v1_botlink_proto_rawDescGZIP(), []int{1} } func (x *ToBot) GetCommand() *Command { if x != nil { return x.Command } return nil } // Hello registers the bot on connect. instance_id identifies the bot process for // gateway-side logging and metrics; owns_updates reports whether this bot runs the // exclusive getUpdates long-poll (exactly one bot must, else Telegram returns 409). type Hello struct { state protoimpl.MessageState `protogen:"open.v1"` InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` OwnsUpdates bool `protobuf:"varint,2,opt,name=owns_updates,json=ownsUpdates,proto3" json:"owns_updates,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Hello) Reset() { *x = Hello{} mi := &file_botlink_v1_botlink_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Hello) String() string { return protoimpl.X.MessageStringOf(x) } func (*Hello) ProtoMessage() {} func (x *Hello) ProtoReflect() protoreflect.Message { mi := &file_botlink_v1_botlink_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 Hello.ProtoReflect.Descriptor instead. func (*Hello) Descriptor() ([]byte, []int) { return file_botlink_v1_botlink_proto_rawDescGZIP(), []int{2} } func (x *Hello) GetInstanceId() string { if x != nil { return x.InstanceId } return "" } func (x *Hello) GetOwnsUpdates() bool { if x != nil { return x.OwnsUpdates } return false } // Command is one send instruction addressed by command_id, which the bot echoes in // its Ack. Exactly one payload is set; the payloads reuse the connector request // shapes from scrabble.telegram.v1. type Command struct { state protoimpl.MessageState `protogen:"open.v1"` CommandId string `protobuf:"bytes,1,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"` // Types that are valid to be assigned to Payload: // // *Command_Notify // *Command_SendToUser // *Command_SendToChannel Payload isCommand_Payload `protobuf_oneof:"payload"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Command) Reset() { *x = Command{} mi := &file_botlink_v1_botlink_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Command) String() string { return protoimpl.X.MessageStringOf(x) } func (*Command) ProtoMessage() {} func (x *Command) ProtoReflect() protoreflect.Message { mi := &file_botlink_v1_botlink_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 Command.ProtoReflect.Descriptor instead. func (*Command) Descriptor() ([]byte, []int) { return file_botlink_v1_botlink_proto_rawDescGZIP(), []int{3} } func (x *Command) GetCommandId() string { if x != nil { return x.CommandId } return "" } func (x *Command) GetPayload() isCommand_Payload { if x != nil { return x.Payload } return nil } func (x *Command) GetNotify() *v1.NotifyRequest { if x != nil { if x, ok := x.Payload.(*Command_Notify); ok { return x.Notify } } return nil } func (x *Command) GetSendToUser() *v1.SendToUserRequest { if x != nil { if x, ok := x.Payload.(*Command_SendToUser); ok { return x.SendToUser } } return nil } func (x *Command) GetSendToChannel() *v1.SendToGameChannelRequest { if x != nil { if x, ok := x.Payload.(*Command_SendToChannel); ok { return x.SendToChannel } } return nil } type isCommand_Payload interface { isCommand_Payload() } type Command_Notify struct { Notify *v1.NotifyRequest `protobuf:"bytes,2,opt,name=notify,proto3,oneof"` } type Command_SendToUser struct { SendToUser *v1.SendToUserRequest `protobuf:"bytes,3,opt,name=send_to_user,json=sendToUser,proto3,oneof"` } type Command_SendToChannel struct { SendToChannel *v1.SendToGameChannelRequest `protobuf:"bytes,4,opt,name=send_to_channel,json=sendToChannel,proto3,oneof"` } func (*Command_Notify) isCommand_Payload() {} func (*Command_SendToUser) isCommand_Payload() {} func (*Command_SendToChannel) isCommand_Payload() {} // Ack reports the outcome of the Command with command_id. delivered mirrors the // connector delivery semantics (false when the kind is not rendered out-of-app, the // user never started the bot, or no channel is configured); error carries an // unexpected transport/render failure, distinct from a clean not-delivered. type Ack struct { state protoimpl.MessageState `protogen:"open.v1"` CommandId string `protobuf:"bytes,1,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"` Delivered bool `protobuf:"varint,2,opt,name=delivered,proto3" json:"delivered,omitempty"` Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Ack) Reset() { *x = Ack{} mi := &file_botlink_v1_botlink_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Ack) String() string { return protoimpl.X.MessageStringOf(x) } func (*Ack) ProtoMessage() {} func (x *Ack) ProtoReflect() protoreflect.Message { mi := &file_botlink_v1_botlink_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 Ack.ProtoReflect.Descriptor instead. func (*Ack) Descriptor() ([]byte, []int) { return file_botlink_v1_botlink_proto_rawDescGZIP(), []int{4} } func (x *Ack) GetCommandId() string { if x != nil { return x.CommandId } return "" } func (x *Ack) GetDelivered() bool { if x != nil { return x.Delivered } return false } func (x *Ack) GetError() string { if x != nil { return x.Error } return "" } var File_botlink_v1_botlink_proto protoreflect.FileDescriptor const file_botlink_v1_botlink_proto_rawDesc = "" + "\n" + "\x18botlink/v1/botlink.proto\x12\x13scrabble.botlink.v1\x1a\x1atelegram/v1/telegram.proto\"r\n" + "\aFromBot\x122\n" + "\x05hello\x18\x01 \x01(\v2\x1a.scrabble.botlink.v1.HelloH\x00R\x05hello\x12,\n" + "\x03ack\x18\x02 \x01(\v2\x18.scrabble.botlink.v1.AckH\x00R\x03ackB\x05\n" + "\x03msg\"?\n" + "\x05ToBot\x126\n" + "\acommand\x18\x01 \x01(\v2\x1c.scrabble.botlink.v1.CommandR\acommand\"K\n" + "\x05Hello\x12\x1f\n" + "\vinstance_id\x18\x01 \x01(\tR\n" + "instanceId\x12!\n" + "\fowns_updates\x18\x02 \x01(\bR\vownsUpdates\"\x99\x02\n" + "\aCommand\x12\x1d\n" + "\n" + "command_id\x18\x01 \x01(\tR\tcommandId\x12=\n" + "\x06notify\x18\x02 \x01(\v2#.scrabble.telegram.v1.NotifyRequestH\x00R\x06notify\x12K\n" + "\fsend_to_user\x18\x03 \x01(\v2'.scrabble.telegram.v1.SendToUserRequestH\x00R\n" + "sendToUser\x12X\n" + "\x0fsend_to_channel\x18\x04 \x01(\v2..scrabble.telegram.v1.SendToGameChannelRequestH\x00R\rsendToChannelB\t\n" + "\apayload\"X\n" + "\x03Ack\x12\x1d\n" + "\n" + "command_id\x18\x01 \x01(\tR\tcommandId\x12\x1c\n" + "\tdelivered\x18\x02 \x01(\bR\tdelivered\x12\x14\n" + "\x05error\x18\x03 \x01(\tR\x05error2O\n" + "\aBotLink\x12D\n" + "\x04Link\x12\x1c.scrabble.botlink.v1.FromBot\x1a\x1a.scrabble.botlink.v1.ToBot(\x010\x01B)Z'scrabble/pkg/proto/botlink/v1;botlinkv1b\x06proto3" var ( file_botlink_v1_botlink_proto_rawDescOnce sync.Once file_botlink_v1_botlink_proto_rawDescData []byte ) func file_botlink_v1_botlink_proto_rawDescGZIP() []byte { file_botlink_v1_botlink_proto_rawDescOnce.Do(func() { file_botlink_v1_botlink_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_botlink_v1_botlink_proto_rawDesc), len(file_botlink_v1_botlink_proto_rawDesc))) }) return file_botlink_v1_botlink_proto_rawDescData } var file_botlink_v1_botlink_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_botlink_v1_botlink_proto_goTypes = []any{ (*FromBot)(nil), // 0: scrabble.botlink.v1.FromBot (*ToBot)(nil), // 1: scrabble.botlink.v1.ToBot (*Hello)(nil), // 2: scrabble.botlink.v1.Hello (*Command)(nil), // 3: scrabble.botlink.v1.Command (*Ack)(nil), // 4: scrabble.botlink.v1.Ack (*v1.NotifyRequest)(nil), // 5: scrabble.telegram.v1.NotifyRequest (*v1.SendToUserRequest)(nil), // 6: scrabble.telegram.v1.SendToUserRequest (*v1.SendToGameChannelRequest)(nil), // 7: scrabble.telegram.v1.SendToGameChannelRequest } var file_botlink_v1_botlink_proto_depIdxs = []int32{ 2, // 0: scrabble.botlink.v1.FromBot.hello:type_name -> scrabble.botlink.v1.Hello 4, // 1: scrabble.botlink.v1.FromBot.ack:type_name -> scrabble.botlink.v1.Ack 3, // 2: scrabble.botlink.v1.ToBot.command:type_name -> scrabble.botlink.v1.Command 5, // 3: scrabble.botlink.v1.Command.notify:type_name -> scrabble.telegram.v1.NotifyRequest 6, // 4: scrabble.botlink.v1.Command.send_to_user:type_name -> scrabble.telegram.v1.SendToUserRequest 7, // 5: scrabble.botlink.v1.Command.send_to_channel:type_name -> scrabble.telegram.v1.SendToGameChannelRequest 0, // 6: scrabble.botlink.v1.BotLink.Link:input_type -> scrabble.botlink.v1.FromBot 1, // 7: scrabble.botlink.v1.BotLink.Link:output_type -> scrabble.botlink.v1.ToBot 7, // [7:8] is the sub-list for method output_type 6, // [6:7] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension extendee 0, // [0:6] is the sub-list for field type_name } func init() { file_botlink_v1_botlink_proto_init() } func file_botlink_v1_botlink_proto_init() { if File_botlink_v1_botlink_proto != nil { return } file_botlink_v1_botlink_proto_msgTypes[0].OneofWrappers = []any{ (*FromBot_Hello)(nil), (*FromBot_Ack)(nil), } file_botlink_v1_botlink_proto_msgTypes[3].OneofWrappers = []any{ (*Command_Notify)(nil), (*Command_SendToUser)(nil), (*Command_SendToChannel)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_botlink_v1_botlink_proto_rawDesc), len(file_botlink_v1_botlink_proto_rawDesc)), NumEnums: 0, NumMessages: 5, NumExtensions: 0, NumServices: 1, }, GoTypes: file_botlink_v1_botlink_proto_goTypes, DependencyIndexes: file_botlink_v1_botlink_proto_depIdxs, MessageInfos: file_botlink_v1_botlink_proto_msgTypes, }.Build() File_botlink_v1_botlink_proto = out.File file_botlink_v1_botlink_proto_goTypes = nil file_botlink_v1_botlink_proto_depIdxs = nil }