Преглед на файлове

SVI Доработка proto-файла, переменных окружения

SVI преди 2 години
родител
ревизия
b8f9c3aabc
променени са 6 файла, в които са добавени 210 реда и са изтрити 98 реда
  1. 3 0
      gobus_dev.sh
  2. 8 1
      internal/serv_grpc/serv_grpc.go
  3. 12 1
      internal/service/service.go
  4. 9 2
      pkg/net/gobus.proto
  5. 173 89
      pkg/net/netapi/gobus.pb.go
  6. 5 5
      pkg/net/netapi/gobus_grpc.pb.go

+ 3 - 0
gobus_dev.sh

@@ -1,2 +1,5 @@
+# Порт для GRPC-сервера
+export SERV_GRPC_PORT=18050
+
 cd ./bin && \
 ./gobus_race

+ 8 - 1
internal/serv_grpc/serv_grpc.go

@@ -3,6 +3,7 @@ package serv_grpc
 
 import (
 	"fmt"
+	"log"
 	"os"
 )
 
@@ -11,10 +12,16 @@ type ServGrpc struct{}
 
 // NewServGrpc -- возвращает новый GRPC-сервер шины данных
 func NewServGrpc() (*ServGrpc, error) {
+	log.Printf("NewServGrpc()\n")
 	port := os.Getenv("SERV_GRPC_PORT")
 	if port == "" {
-		return nil, fmt.Errorf("NewServGrpc(): ")
+		return nil, fmt.Errorf("NewServGrpc(): env SERV_GRPC_PORT not set")
 	}
 	sf := &ServGrpc{}
 	return sf, nil
 }
+
+// Run -- запускает GRPC-сервер в работу
+func (sf *ServGrpc) Run() {
+	log.Printf("ServGrpc.Run()\n")
+}

+ 12 - 1
internal/service/service.go

@@ -1,16 +1,27 @@
 // package service -- главный тип сервиса шины данных
 package service
 
-import "log"
+import (
+	"fmt"
+	"log"
+
+	"p78git.ddns.net/svi/gobus/internal/serv_grpc"
+)
 
 // Service -- главный тип сервиса шины данных
 type Service struct {
+	servGrpc *serv_grpc.ServGrpc
 }
 
 // NewSevice -- взвращае тновый сервис
 func NewSevice() (*Service, error) {
 	log.Printf("NewService()\n")
 	sf := &Service{}
+	var err error
+	sf.servGrpc, err = serv_grpc.NewServGrpc()
+	if err != nil {
+		return nil, fmt.Errorf("NewService(): in create ServGrpc, err=\n\t%v\n", err)
+	}
 	return sf, nil
 }
 

+ 9 - 2
pkg/net/gobus.proto

@@ -18,11 +18,18 @@ service GoBus {
     // Subscribe -- подписка по шаблону
     rpc Subscribe(SubscribeRequest) returns (stream SyncResponse){}
     // SubscribeBuffer -- подписка по шаблону с буфером на выход
-    rpc SubscribeBuffer (SubscribeRequest) returns (stream BuffResponse){}
+    rpc SubscribeBuffer (BuffRequest) returns (stream BuffResponse){}
     // Get -- возвращает значения топиков по шаблону
     rpc Get(SubscribeRequest) returns (GetRequest){}
 }
 
+// BuffRequest -- запрос на буферизованную подписку
+message BuffRequest{
+    string Sample         = 1; // Шаблон топиков на подписку
+    int32 MsgCountLimit   = 2; // Предел количества буферизуемых сообщений
+    int32 MsgSumSizeLimit = 3; // Предел суммарного количества сообщений
+}
+
 // BuffResponse -- ответ на буферизованную подписку
 message BuffResponse{
     bool IsLost = 1; // Признак, что часть данных была потеряна
@@ -35,7 +42,7 @@ message GetRequest{
 
 // SubscribeRequest -- запрос на подписку топиков по шаблону
 message SubscribeRequest{
-    string Sample =1; // Шаблон топика на подписку
+    string Sample = 1; // Шаблон топиков на подписку
 }
 
 // SyncRequest -- синхронный запрос в шину данных

+ 173 - 89
pkg/net/netapi/gobus.pb.go

@@ -24,6 +24,70 @@ const (
 	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
 )
 
+// BuffRequest -- запрос на буферизованную подписку
+type BuffRequest struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Sample          string `protobuf:"bytes,1,opt,name=Sample,proto3" json:"Sample,omitempty"`                    // Шаблон топиков на подписку
+	MsgCountLimit   int32  `protobuf:"varint,2,opt,name=MsgCountLimit,proto3" json:"MsgCountLimit,omitempty"`     // Предел количества буферизуемых сообщений
+	MsgSumSizeLimit int32  `protobuf:"varint,3,opt,name=MsgSumSizeLimit,proto3" json:"MsgSumSizeLimit,omitempty"` // Предел суммарного количества сообщений
+}
+
+func (x *BuffRequest) Reset() {
+	*x = BuffRequest{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_pkg_net_gobus_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *BuffRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BuffRequest) ProtoMessage() {}
+
+func (x *BuffRequest) ProtoReflect() protoreflect.Message {
+	mi := &file_pkg_net_gobus_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use BuffRequest.ProtoReflect.Descriptor instead.
+func (*BuffRequest) Descriptor() ([]byte, []int) {
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *BuffRequest) GetSample() string {
+	if x != nil {
+		return x.Sample
+	}
+	return ""
+}
+
+func (x *BuffRequest) GetMsgCountLimit() int32 {
+	if x != nil {
+		return x.MsgCountLimit
+	}
+	return 0
+}
+
+func (x *BuffRequest) GetMsgSumSizeLimit() int32 {
+	if x != nil {
+		return x.MsgSumSizeLimit
+	}
+	return 0
+}
+
 // BuffResponse -- ответ на буферизованную подписку
 type BuffResponse struct {
 	state         protoimpl.MessageState
@@ -36,7 +100,7 @@ type BuffResponse struct {
 func (x *BuffResponse) Reset() {
 	*x = BuffResponse{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pkg_net_gobus_proto_msgTypes[0]
+		mi := &file_pkg_net_gobus_proto_msgTypes[1]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -49,7 +113,7 @@ func (x *BuffResponse) String() string {
 func (*BuffResponse) ProtoMessage() {}
 
 func (x *BuffResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_pkg_net_gobus_proto_msgTypes[0]
+	mi := &file_pkg_net_gobus_proto_msgTypes[1]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -62,7 +126,7 @@ func (x *BuffResponse) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use BuffResponse.ProtoReflect.Descriptor instead.
 func (*BuffResponse) Descriptor() ([]byte, []int) {
-	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{0}
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{1}
 }
 
 func (x *BuffResponse) GetIsLost() bool {
@@ -84,7 +148,7 @@ type GetRequest struct {
 func (x *GetRequest) Reset() {
 	*x = GetRequest{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pkg_net_gobus_proto_msgTypes[1]
+		mi := &file_pkg_net_gobus_proto_msgTypes[2]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -97,7 +161,7 @@ func (x *GetRequest) String() string {
 func (*GetRequest) ProtoMessage() {}
 
 func (x *GetRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_pkg_net_gobus_proto_msgTypes[1]
+	mi := &file_pkg_net_gobus_proto_msgTypes[2]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -110,7 +174,7 @@ func (x *GetRequest) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
 func (*GetRequest) Descriptor() ([]byte, []int) {
-	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{1}
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{2}
 }
 
 func (x *GetRequest) GetMsg() [][]byte {
@@ -126,13 +190,13 @@ type SubscribeRequest struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Sample string `protobuf:"bytes,1,opt,name=Sample,proto3" json:"Sample,omitempty"` // Шаблон топика на подписку
+	Sample string `protobuf:"bytes,1,opt,name=Sample,proto3" json:"Sample,omitempty"` // Шаблон топиков на подписку
 }
 
 func (x *SubscribeRequest) Reset() {
 	*x = SubscribeRequest{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pkg_net_gobus_proto_msgTypes[2]
+		mi := &file_pkg_net_gobus_proto_msgTypes[3]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -145,7 +209,7 @@ func (x *SubscribeRequest) String() string {
 func (*SubscribeRequest) ProtoMessage() {}
 
 func (x *SubscribeRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_pkg_net_gobus_proto_msgTypes[2]
+	mi := &file_pkg_net_gobus_proto_msgTypes[3]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -158,7 +222,7 @@ func (x *SubscribeRequest) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.
 func (*SubscribeRequest) Descriptor() ([]byte, []int) {
-	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{2}
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{3}
 }
 
 func (x *SubscribeRequest) GetSample() string {
@@ -182,7 +246,7 @@ type SyncRequest struct {
 func (x *SyncRequest) Reset() {
 	*x = SyncRequest{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pkg_net_gobus_proto_msgTypes[3]
+		mi := &file_pkg_net_gobus_proto_msgTypes[4]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -195,7 +259,7 @@ func (x *SyncRequest) String() string {
 func (*SyncRequest) ProtoMessage() {}
 
 func (x *SyncRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_pkg_net_gobus_proto_msgTypes[3]
+	mi := &file_pkg_net_gobus_proto_msgTypes[4]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -208,7 +272,7 @@ func (x *SyncRequest) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.
 func (*SyncRequest) Descriptor() ([]byte, []int) {
-	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{3}
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{4}
 }
 
 func (x *SyncRequest) GetSource() int32 {
@@ -244,7 +308,7 @@ type SyncResponse struct {
 func (x *SyncResponse) Reset() {
 	*x = SyncResponse{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pkg_net_gobus_proto_msgTypes[4]
+		mi := &file_pkg_net_gobus_proto_msgTypes[5]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -257,7 +321,7 @@ func (x *SyncResponse) String() string {
 func (*SyncResponse) ProtoMessage() {}
 
 func (x *SyncResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_pkg_net_gobus_proto_msgTypes[4]
+	mi := &file_pkg_net_gobus_proto_msgTypes[5]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -270,7 +334,7 @@ func (x *SyncResponse) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead.
 func (*SyncResponse) Descriptor() ([]byte, []int) {
-	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{4}
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{5}
 }
 
 func (x *SyncResponse) GetMsg() []byte {
@@ -294,7 +358,7 @@ type PublicRequest struct {
 func (x *PublicRequest) Reset() {
 	*x = PublicRequest{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pkg_net_gobus_proto_msgTypes[5]
+		mi := &file_pkg_net_gobus_proto_msgTypes[6]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -307,7 +371,7 @@ func (x *PublicRequest) String() string {
 func (*PublicRequest) ProtoMessage() {}
 
 func (x *PublicRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_pkg_net_gobus_proto_msgTypes[5]
+	mi := &file_pkg_net_gobus_proto_msgTypes[6]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -320,7 +384,7 @@ func (x *PublicRequest) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use PublicRequest.ProtoReflect.Descriptor instead.
 func (*PublicRequest) Descriptor() ([]byte, []int) {
-	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{5}
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{6}
 }
 
 func (x *PublicRequest) GetSource() int32 {
@@ -354,7 +418,7 @@ type DefaultResponse struct {
 func (x *DefaultResponse) Reset() {
 	*x = DefaultResponse{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_pkg_net_gobus_proto_msgTypes[6]
+		mi := &file_pkg_net_gobus_proto_msgTypes[7]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -367,7 +431,7 @@ func (x *DefaultResponse) String() string {
 func (*DefaultResponse) ProtoMessage() {}
 
 func (x *DefaultResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_pkg_net_gobus_proto_msgTypes[6]
+	mi := &file_pkg_net_gobus_proto_msgTypes[7]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -380,7 +444,7 @@ func (x *DefaultResponse) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use DefaultResponse.ProtoReflect.Descriptor instead.
 func (*DefaultResponse) Descriptor() ([]byte, []int) {
-	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{6}
+	return file_pkg_net_gobus_proto_rawDescGZIP(), []int{7}
 }
 
 var File_pkg_net_gobus_proto protoreflect.FileDescriptor
@@ -388,49 +452,56 @@ var File_pkg_net_gobus_proto protoreflect.FileDescriptor
 var file_pkg_net_gobus_proto_rawDesc = []byte{
 	0x0a, 0x13, 0x70, 0x6b, 0x67, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x62, 0x75, 0x73, 0x2e,
 	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x22,
-	0x26, 0x0a, 0x0c, 0x42, 0x75, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
-	0x16, 0x0a, 0x06, 0x49, 0x73, 0x4c, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
-	0x06, 0x49, 0x73, 0x4c, 0x6f, 0x73, 0x74, 0x22, 0x1e, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65,
-	0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x03,
-	0x28, 0x0c, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0x2a, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63,
-	0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53,
-	0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x61, 0x6d,
-	0x70, 0x6c, 0x65, 0x22, 0x4d, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65,
-	0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
-	0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f,
-	0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63,
-	0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x4d,
-	0x73, 0x67, 0x22, 0x20, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
-	0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
-	0x03, 0x4d, 0x73, 0x67, 0x22, 0x4f, 0x0a, 0x0d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x65,
-	0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a,
-	0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f,
-	0x70, 0x69, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c,
-	0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0x11, 0x0a, 0x0f, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
-	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xcf, 0x02, 0x0a, 0x05, 0x47, 0x6f, 0x42,
-	0x75, 0x73, 0x12, 0x3e, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x17, 0x2e, 0x70,
-	0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x65,
-	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e,
-	0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
-	0x22, 0x00, 0x12, 0x3b, 0x0a, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x15,
-	0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65,
+	0x75, 0x0a, 0x0b, 0x42, 0x75, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16,
+	0x0a, 0x06, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
+	0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x75,
+	0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x4d,
+	0x73, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x0f,
+	0x4d, 0x73, 0x67, 0x53, 0x75, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x6d, 0x53, 0x69, 0x7a,
+	0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x26, 0x0a, 0x0c, 0x42, 0x75, 0x66, 0x66, 0x52, 0x65,
+	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x4c, 0x6f, 0x73, 0x74,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x4c, 0x6f, 0x73, 0x74, 0x22, 0x1e,
+	0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03,
+	0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0x2a,
+	0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+	0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x06, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0x4d, 0x0a, 0x0b, 0x53, 0x79,
+	0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75,
+	0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0x20, 0x0a, 0x0c, 0x53, 0x79, 0x6e,
+	0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0x4f, 0x0a, 0x0d, 0x50,
+	0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06,
+	0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f,
+	0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73,
+	0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0x11, 0x0a, 0x0f,
+	0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32,
+	0xca, 0x02, 0x0a, 0x05, 0x47, 0x6f, 0x42, 0x75, 0x73, 0x12, 0x3e, 0x0a, 0x06, 0x50, 0x75, 0x62,
+	0x6c, 0x69, 0x63, 0x12, 0x17, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x50,
+	0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70,
+	0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52,
+	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x08, 0x53, 0x65, 0x6e,
+	0x64, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x15, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e,
+	0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70,
+	0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70,
+	0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
+	0x69, 0x62, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x53,
+	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+	0x16, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52,
+	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0f, 0x53,
+	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x12, 0x15,
+	0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x42, 0x75, 0x66, 0x66, 0x52, 0x65,
 	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e,
-	0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
-	0x43, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x1a, 0x2e, 0x70,
-	0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
-	0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65,
-	0x72, 0x69, 0x6e, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
-	0x22, 0x00, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
-	0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72,
-	0x69, 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75,
-	0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x42,
-	0x75, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12,
-	0x39, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69,
-	0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
-	0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e, 0x47, 0x65,
-	0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f,
-	0x6e, 0x65, 0x74, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x2e, 0x42, 0x75, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30,
+	0x01, 0x12, 0x39, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65,
+	0x72, 0x69, 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71,
+	0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x2e,
+	0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08,
+	0x2e, 0x2f, 0x6e, 0x65, 0x74, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -445,27 +516,28 @@ func file_pkg_net_gobus_proto_rawDescGZIP() []byte {
 	return file_pkg_net_gobus_proto_rawDescData
 }
 
-var file_pkg_net_gobus_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
+var file_pkg_net_gobus_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
 var file_pkg_net_gobus_proto_goTypes = []interface{}{
-	(*BuffResponse)(nil),     // 0: parserin.BuffResponse
-	(*GetRequest)(nil),       // 1: parserin.GetRequest
-	(*SubscribeRequest)(nil), // 2: parserin.SubscribeRequest
-	(*SyncRequest)(nil),      // 3: parserin.SyncRequest
-	(*SyncResponse)(nil),     // 4: parserin.SyncResponse
-	(*PublicRequest)(nil),    // 5: parserin.PublicRequest
-	(*DefaultResponse)(nil),  // 6: parserin.DefaultResponse
+	(*BuffRequest)(nil),      // 0: parserin.BuffRequest
+	(*BuffResponse)(nil),     // 1: parserin.BuffResponse
+	(*GetRequest)(nil),       // 2: parserin.GetRequest
+	(*SubscribeRequest)(nil), // 3: parserin.SubscribeRequest
+	(*SyncRequest)(nil),      // 4: parserin.SyncRequest
+	(*SyncResponse)(nil),     // 5: parserin.SyncResponse
+	(*PublicRequest)(nil),    // 6: parserin.PublicRequest
+	(*DefaultResponse)(nil),  // 7: parserin.DefaultResponse
 }
 var file_pkg_net_gobus_proto_depIdxs = []int32{
-	5, // 0: parserin.GoBus.Public:input_type -> parserin.PublicRequest
-	3, // 1: parserin.GoBus.SendSync:input_type -> parserin.SyncRequest
-	2, // 2: parserin.GoBus.Subscribe:input_type -> parserin.SubscribeRequest
-	2, // 3: parserin.GoBus.SubscribeBuffer:input_type -> parserin.SubscribeRequest
-	2, // 4: parserin.GoBus.Get:input_type -> parserin.SubscribeRequest
-	6, // 5: parserin.GoBus.Public:output_type -> parserin.DefaultResponse
-	4, // 6: parserin.GoBus.SendSync:output_type -> parserin.SyncResponse
-	4, // 7: parserin.GoBus.Subscribe:output_type -> parserin.SyncResponse
-	0, // 8: parserin.GoBus.SubscribeBuffer:output_type -> parserin.BuffResponse
-	1, // 9: parserin.GoBus.Get:output_type -> parserin.GetRequest
+	6, // 0: parserin.GoBus.Public:input_type -> parserin.PublicRequest
+	4, // 1: parserin.GoBus.SendSync:input_type -> parserin.SyncRequest
+	3, // 2: parserin.GoBus.Subscribe:input_type -> parserin.SubscribeRequest
+	0, // 3: parserin.GoBus.SubscribeBuffer:input_type -> parserin.BuffRequest
+	3, // 4: parserin.GoBus.Get:input_type -> parserin.SubscribeRequest
+	7, // 5: parserin.GoBus.Public:output_type -> parserin.DefaultResponse
+	5, // 6: parserin.GoBus.SendSync:output_type -> parserin.SyncResponse
+	5, // 7: parserin.GoBus.Subscribe:output_type -> parserin.SyncResponse
+	1, // 8: parserin.GoBus.SubscribeBuffer:output_type -> parserin.BuffResponse
+	2, // 9: parserin.GoBus.Get:output_type -> parserin.GetRequest
 	5, // [5:10] is the sub-list for method output_type
 	0, // [0:5] is the sub-list for method input_type
 	0, // [0:0] is the sub-list for extension type_name
@@ -480,7 +552,7 @@ func file_pkg_net_gobus_proto_init() {
 	}
 	if !protoimpl.UnsafeEnabled {
 		file_pkg_net_gobus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*BuffResponse); i {
+			switch v := v.(*BuffRequest); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -492,7 +564,7 @@ func file_pkg_net_gobus_proto_init() {
 			}
 		}
 		file_pkg_net_gobus_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetRequest); i {
+			switch v := v.(*BuffResponse); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -504,7 +576,7 @@ func file_pkg_net_gobus_proto_init() {
 			}
 		}
 		file_pkg_net_gobus_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*SubscribeRequest); i {
+			switch v := v.(*GetRequest); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -516,7 +588,7 @@ func file_pkg_net_gobus_proto_init() {
 			}
 		}
 		file_pkg_net_gobus_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*SyncRequest); i {
+			switch v := v.(*SubscribeRequest); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -528,7 +600,7 @@ func file_pkg_net_gobus_proto_init() {
 			}
 		}
 		file_pkg_net_gobus_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*SyncResponse); i {
+			switch v := v.(*SyncRequest); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -540,7 +612,7 @@ func file_pkg_net_gobus_proto_init() {
 			}
 		}
 		file_pkg_net_gobus_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*PublicRequest); i {
+			switch v := v.(*SyncResponse); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -552,6 +624,18 @@ func file_pkg_net_gobus_proto_init() {
 			}
 		}
 		file_pkg_net_gobus_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PublicRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_pkg_net_gobus_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*DefaultResponse); i {
 			case 0:
 				return &v.state
@@ -570,7 +654,7 @@ func file_pkg_net_gobus_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_pkg_net_gobus_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   7,
+			NumMessages:   8,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 5 - 5
pkg/net/netapi/gobus_grpc.pb.go

@@ -41,7 +41,7 @@ type GoBusClient interface {
 	// Subscribe -- подписка по шаблону
 	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (GoBus_SubscribeClient, error)
 	// SubscribeBuffer -- подписка по шаблону с буфером на выход
-	SubscribeBuffer(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (GoBus_SubscribeBufferClient, error)
+	SubscribeBuffer(ctx context.Context, in *BuffRequest, opts ...grpc.CallOption) (GoBus_SubscribeBufferClient, error)
 	// Get -- возвращает значения топиков по шаблону
 	Get(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*GetRequest, error)
 }
@@ -104,7 +104,7 @@ func (x *goBusSubscribeClient) Recv() (*SyncResponse, error) {
 	return m, nil
 }
 
-func (c *goBusClient) SubscribeBuffer(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (GoBus_SubscribeBufferClient, error) {
+func (c *goBusClient) SubscribeBuffer(ctx context.Context, in *BuffRequest, opts ...grpc.CallOption) (GoBus_SubscribeBufferClient, error) {
 	stream, err := c.cc.NewStream(ctx, &GoBus_ServiceDesc.Streams[1], GoBus_SubscribeBuffer_FullMethodName, opts...)
 	if err != nil {
 		return nil, err
@@ -156,7 +156,7 @@ type GoBusServer interface {
 	// Subscribe -- подписка по шаблону
 	Subscribe(*SubscribeRequest, GoBus_SubscribeServer) error
 	// SubscribeBuffer -- подписка по шаблону с буфером на выход
-	SubscribeBuffer(*SubscribeRequest, GoBus_SubscribeBufferServer) error
+	SubscribeBuffer(*BuffRequest, GoBus_SubscribeBufferServer) error
 	// Get -- возвращает значения топиков по шаблону
 	Get(context.Context, *SubscribeRequest) (*GetRequest, error)
 	mustEmbedUnimplementedGoBusServer()
@@ -175,7 +175,7 @@ func (UnimplementedGoBusServer) SendSync(context.Context, *SyncRequest) (*SyncRe
 func (UnimplementedGoBusServer) Subscribe(*SubscribeRequest, GoBus_SubscribeServer) error {
 	return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
 }
-func (UnimplementedGoBusServer) SubscribeBuffer(*SubscribeRequest, GoBus_SubscribeBufferServer) error {
+func (UnimplementedGoBusServer) SubscribeBuffer(*BuffRequest, GoBus_SubscribeBufferServer) error {
 	return status.Errorf(codes.Unimplemented, "method SubscribeBuffer not implemented")
 }
 func (UnimplementedGoBusServer) Get(context.Context, *SubscribeRequest) (*GetRequest, error) {
@@ -252,7 +252,7 @@ func (x *goBusSubscribeServer) Send(m *SyncResponse) error {
 }
 
 func _GoBus_SubscribeBuffer_Handler(srv interface{}, stream grpc.ServerStream) error {
-	m := new(SubscribeRequest)
+	m := new(BuffRequest)
 	if err := stream.RecvMsg(m); err != nil {
 		return err
 	}