@ -25,7 +25,7 @@ const (
)
// 消息
type String struct {
type PublishRequest struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
@ -33,8 +33,8 @@ type String struct {
Value string ` protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" `
}
func ( x * String ) Reset ( ) {
* x = String { }
func ( x * PublishRequest ) Reset ( ) {
* x = PublishRequest { }
if protoimpl . UnsafeEnabled {
mi := & file_pb_pubsub_proto_msgTypes [ 0 ]
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
@ -42,13 +42,13 @@ func (x *String) Reset() {
}
}
func ( x * String ) String ( ) string {
func ( x * PublishRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
}
func ( * String ) ProtoMessage ( ) { }
func ( * PublishRequest ) ProtoMessage ( ) { }
func ( x * String ) ProtoReflect ( ) protoreflect . Message {
func ( x * PublishRequest ) ProtoReflect ( ) protoreflect . Message {
mi := & file_pb_pubsub_proto_msgTypes [ 0 ]
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
@ -60,31 +60,153 @@ func (x *String) ProtoReflect() protoreflect.Message {
return mi . MessageOf ( x )
}
// Deprecated: Use String .ProtoReflect.Descriptor instead.
func ( * String ) Descriptor ( ) ( [ ] byte , [ ] int ) {
// Deprecated: Use PublishRequest .ProtoReflect.Descriptor instead.
func ( * PublishRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
return file_pb_pubsub_proto_rawDescGZIP ( ) , [ ] int { 0 }
}
func ( x * String ) GetValue ( ) string {
func ( x * PublishRequest ) GetValue ( ) string {
if x != nil {
return x . Value
}
return ""
}
// 请求消息
type SubscribeRequest struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Value string ` protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" `
Ip string ` protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty" `
}
func ( x * SubscribeRequest ) Reset ( ) {
* x = SubscribeRequest { }
if protoimpl . UnsafeEnabled {
mi := & file_pb_pubsub_proto_msgTypes [ 1 ]
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
}
func ( x * SubscribeRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
}
func ( * SubscribeRequest ) ProtoMessage ( ) { }
func ( x * SubscribeRequest ) ProtoReflect ( ) protoreflect . Message {
mi := & file_pb_pubsub_proto_msgTypes [ 1 ]
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 SubscribeRequest.ProtoReflect.Descriptor instead.
func ( * SubscribeRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
return file_pb_pubsub_proto_rawDescGZIP ( ) , [ ] int { 1 }
}
func ( x * SubscribeRequest ) GetValue ( ) string {
if x != nil {
return x . Value
}
return ""
}
func ( x * SubscribeRequest ) GetIp ( ) string {
if x != nil {
return x . Ip
}
return ""
}
// 响应消息
type SubscribeResponse struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Value string ` protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" `
Ip string ` protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty" `
}
func ( x * SubscribeResponse ) Reset ( ) {
* x = SubscribeResponse { }
if protoimpl . UnsafeEnabled {
mi := & file_pb_pubsub_proto_msgTypes [ 2 ]
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
}
func ( x * SubscribeResponse ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
}
func ( * SubscribeResponse ) ProtoMessage ( ) { }
func ( x * SubscribeResponse ) ProtoReflect ( ) protoreflect . Message {
mi := & file_pb_pubsub_proto_msgTypes [ 2 ]
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 SubscribeResponse.ProtoReflect.Descriptor instead.
func ( * SubscribeResponse ) Descriptor ( ) ( [ ] byte , [ ] int ) {
return file_pb_pubsub_proto_rawDescGZIP ( ) , [ ] int { 2 }
}
func ( x * SubscribeResponse ) GetValue ( ) string {
if x != nil {
return x . Value
}
return ""
}
func ( x * SubscribeResponse ) GetIp ( ) string {
if x != nil {
return x . Ip
}
return ""
}
var File_pb_pubsub_proto protoreflect . FileDescriptor
var file_pb_pubsub_proto_rawDesc = [ ] byte {
0x0a , 0x0f , 0x70 , 0x62 , 0x2f , 0x70 , 0x75 , 0x62 , 0x73 , 0x75 , 0x62 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 ,
0x6f , 0x12 , 0x02 , 0x70 , 0x62 , 0x22 , 0x1e , 0x0a , 0x06 , 0x53 , 0x74 , 0x72 , 0x69 , 0x6e , 0x67 , 0x12 ,
0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x05 ,
0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x32 , 0x52 , 0x0a , 0x06 , 0x50 , 0x75 , 0x62 , 0x53 , 0x75 , 0x62 , 0x12 ,
0x21 , 0x0a , 0x07 , 0x50 , 0x75 , 0x62 , 0x6c , 0x69 , 0x73 , 0x68 , 0x12 , 0x0a , 0x2e , 0x70 , 0x62 , 0x2e ,
0x53 , 0x74 , 0x72 , 0x69 , 0x6e , 0x67 , 0x1a , 0x0a , 0x2e , 0x70 , 0x62 , 0x2e , 0x53 , 0x74 , 0x72 , 0x69 ,
0x6e , 0x67 , 0x12 , 0x25 , 0x0a , 0x09 , 0x53 , 0x75 , 0x62 , 0x73 , 0x63 , 0x72 , 0x69 , 0x62 , 0x65 , 0x12 ,
0x0a , 0x2e , 0x70 , 0x62 , 0x2e , 0x53 , 0x74 , 0x72 , 0x69 , 0x6e , 0x67 , 0x1a , 0x0a , 0x2e , 0x70 , 0x62 ,
0x2e , 0x53 , 0x74 , 0x72 , 0x69 , 0x6e , 0x67 , 0x30 , 0x01 , 0x42 , 0x07 , 0x5a , 0x05 , 0x2e , 0x2e , 0x2f ,
0x70 , 0x62 , 0x62 , 0x06 , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x33 ,
0x6f , 0x12 , 0x02 , 0x70 , 0x62 , 0x22 , 0x26 , 0x0a , 0x0e , 0x50 , 0x75 , 0x62 , 0x6c , 0x69 , 0x73 , 0x68 ,
0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x12 , 0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 ,
0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x22 , 0x38 , 0x0a ,
0x10 , 0x53 , 0x75 , 0x62 , 0x73 , 0x63 , 0x72 , 0x69 , 0x62 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 ,
0x74 , 0x12 , 0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 ,
0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x12 , 0x0e , 0x0a , 0x02 , 0x69 , 0x70 , 0x18 , 0x02 , 0x20 ,
0x01 , 0x28 , 0x09 , 0x52 , 0x02 , 0x69 , 0x70 , 0x22 , 0x39 , 0x0a , 0x11 , 0x53 , 0x75 , 0x62 , 0x73 , 0x63 ,
0x72 , 0x69 , 0x62 , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 , 0x65 , 0x12 , 0x14 , 0x0a , 0x05 ,
0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x05 , 0x76 , 0x61 , 0x6c ,
0x75 , 0x65 , 0x12 , 0x0e , 0x0a , 0x02 , 0x69 , 0x70 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x02 ,
0x69 , 0x70 , 0x32 , 0x77 , 0x0a , 0x06 , 0x50 , 0x75 , 0x62 , 0x53 , 0x75 , 0x62 , 0x12 , 0x31 , 0x0a , 0x07 ,
0x50 , 0x75 , 0x62 , 0x6c , 0x69 , 0x73 , 0x68 , 0x12 , 0x12 , 0x2e , 0x70 , 0x62 , 0x2e , 0x50 , 0x75 , 0x62 ,
0x6c , 0x69 , 0x73 , 0x68 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x1a , 0x12 , 0x2e , 0x70 , 0x62 ,
0x2e , 0x50 , 0x75 , 0x62 , 0x6c , 0x69 , 0x73 , 0x68 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x12 ,
0x3a , 0x0a , 0x09 , 0x53 , 0x75 , 0x62 , 0x73 , 0x63 , 0x72 , 0x69 , 0x62 , 0x65 , 0x12 , 0x14 , 0x2e , 0x70 ,
0x62 , 0x2e , 0x53 , 0x75 , 0x62 , 0x73 , 0x63 , 0x72 , 0x69 , 0x62 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 ,
0x73 , 0x74 , 0x1a , 0x15 , 0x2e , 0x70 , 0x62 , 0x2e , 0x53 , 0x75 , 0x62 , 0x73 , 0x63 , 0x72 , 0x69 , 0x62 ,
0x65 , 0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 , 0x65 , 0x30 , 0x01 , 0x42 , 0x07 , 0x5a , 0x05 , 0x2e ,
0x2e , 0x2f , 0x70 , 0x62 , 0x62 , 0x06 , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x33 ,
}
var (
@ -99,15 +221,17 @@ func file_pb_pubsub_proto_rawDescGZIP() []byte {
return file_pb_pubsub_proto_rawDescData
}
var file_pb_pubsub_proto_msgTypes = make ( [ ] protoimpl . MessageInfo , 1 )
var file_pb_pubsub_proto_msgTypes = make ( [ ] protoimpl . MessageInfo , 3 )
var file_pb_pubsub_proto_goTypes = [ ] interface { } {
( * String ) ( nil ) , // 0: pb.String
( * PublishRequest ) ( nil ) , // 0: pb.PublishRequest
( * SubscribeRequest ) ( nil ) , // 1: pb.SubscribeRequest
( * SubscribeResponse ) ( nil ) , // 2: pb.SubscribeResponse
}
var file_pb_pubsub_proto_depIdxs = [ ] int32 {
0 , // 0: pb.PubSub.Publish:input_type -> pb. String
0, // 1: pb.PubSub.Subscribe:input_type -> pb.String
0 , // 2: pb.PubSub.Publish:output_type -> pb. String
0, // 3: pb.PubSub.Subscribe:output_type -> pb.String
0 , // 0: pb.PubSub.Publish:input_type -> pb. PublishRequest
1, // 1: pb.PubSub.Subscribe:input_type -> pb.SubscribeRequest
0 , // 2: pb.PubSub.Publish:output_type -> pb. PublishRequest
2, // 3: pb.PubSub.Subscribe:output_type -> pb.SubscribeResponse
2 , // [2:4] is the sub-list for method output_type
0 , // [0:2] is the sub-list for method input_type
0 , // [0:0] is the sub-list for extension type_name
@ -122,7 +246,31 @@ func file_pb_pubsub_proto_init() {
}
if ! protoimpl . UnsafeEnabled {
file_pb_pubsub_proto_msgTypes [ 0 ] . Exporter = func ( v interface { } , i int ) interface { } {
switch v := v . ( * String ) ; i {
switch v := v . ( * PublishRequest ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
file_pb_pubsub_proto_msgTypes [ 1 ] . Exporter = func ( v interface { } , i int ) interface { } {
switch v := v . ( * SubscribeRequest ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
file_pb_pubsub_proto_msgTypes [ 2 ] . Exporter = func ( v interface { } , i int ) interface { } {
switch v := v . ( * SubscribeResponse ) ; i {
case 0 :
return & v . state
case 1 :
@ -140,7 +288,7 @@ func file_pb_pubsub_proto_init() {
GoPackagePath : reflect . TypeOf ( x { } ) . PkgPath ( ) ,
RawDescriptor : file_pb_pubsub_proto_rawDesc ,
NumEnums : 0 ,
NumMessages : 1 ,
NumMessages : 3 ,
NumExtensions : 0 ,
NumServices : 1 ,
} ,