fix rpc svc
This commit is contained in:
parent
92620400b6
commit
3f74b1cb78
@ -10,7 +10,7 @@ message Time {
|
|||||||
}
|
}
|
||||||
|
|
||||||
service PromoCodeService {
|
service PromoCodeService {
|
||||||
rpc GetAllPromoActivations(Time) returns (PromoActivationResp);
|
rpc GetAllPromoActivations(Time) returns (stream PromoActivationResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
message PromoActivationResp {
|
message PromoActivationResp {
|
||||||
@ -18,9 +18,6 @@ message PromoActivationResp {
|
|||||||
string UserID = 1;
|
string UserID = 1;
|
||||||
int64 Time = 2;
|
int64 Time = 2;
|
||||||
}
|
}
|
||||||
|
string ID = 1;
|
||||||
message Activations {
|
repeated UserTime Users = 2;
|
||||||
repeated UserTime values = 1;
|
|
||||||
}
|
|
||||||
map<string, Activations> response = 1;
|
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,8 @@ type PromoActivationResp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Response map[string]*PromoActivationResp_Activations `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||||
|
Users []*PromoActivationResp_UserTime `protobuf:"bytes,2,rep,name=Users,proto3" json:"Users,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PromoActivationResp) Reset() {
|
func (x *PromoActivationResp) Reset() {
|
||||||
@ -115,9 +116,16 @@ func (*PromoActivationResp) Descriptor() ([]byte, []int) {
|
|||||||
return file_promo_proto_rawDescGZIP(), []int{1}
|
return file_promo_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PromoActivationResp) GetResponse() map[string]*PromoActivationResp_Activations {
|
func (x *PromoActivationResp) GetID() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Response
|
return x.ID
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp) GetUsers() []*PromoActivationResp_UserTime {
|
||||||
|
if x != nil {
|
||||||
|
return x.Users
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -177,53 +185,6 @@ func (x *PromoActivationResp_UserTime) GetTime() int64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
type PromoActivationResp_Activations struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Values []*PromoActivationResp_UserTime `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *PromoActivationResp_Activations) Reset() {
|
|
||||||
*x = PromoActivationResp_Activations{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_promo_proto_msgTypes[3]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *PromoActivationResp_Activations) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*PromoActivationResp_Activations) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *PromoActivationResp_Activations) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_promo_proto_msgTypes[3]
|
|
||||||
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 PromoActivationResp_Activations.ProtoReflect.Descriptor instead.
|
|
||||||
func (*PromoActivationResp_Activations) Descriptor() ([]byte, []int) {
|
|
||||||
return file_promo_proto_rawDescGZIP(), []int{1, 1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *PromoActivationResp_Activations) GetValues() []*PromoActivationResp_UserTime {
|
|
||||||
if x != nil {
|
|
||||||
return x.Values
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_promo_proto protoreflect.FileDescriptor
|
var File_promo_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_promo_proto_rawDesc = []byte{
|
var file_promo_proto_rawDesc = []byte{
|
||||||
@ -231,33 +192,22 @@ var file_promo_proto_rawDesc = []byte{
|
|||||||
0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2a, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2a, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||||
0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66,
|
0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66,
|
||||||
0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||||
0x02, 0x74, 0x6f, 0x22, 0xcd, 0x02, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74,
|
0x02, 0x74, 0x6f, 0x22, 0x9b, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74,
|
||||||
0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x08, 0x72,
|
0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e,
|
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x3c, 0x0a, 0x05, 0x55,
|
||||||
0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63,
|
0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x64,
|
||||||
0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x52, 0x65, 0x73,
|
0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70,
|
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x36, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65,
|
0x6d, 0x65, 0x52, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x1a, 0x36, 0x0a, 0x08, 0x55, 0x73, 0x65,
|
||||||
0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18,
|
||||||
0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x4d, 0x0a, 0x0b,
|
0x04, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x54, 0x69, 0x6d,
|
||||||
0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x06, 0x76,
|
0x65, 0x32, 0x5d, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65,
|
||||||
0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f,
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50,
|
||||||
0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69,
|
0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
|
||||||
0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54,
|
0x0e, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x1a,
|
||||||
0x69, 0x6d, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x66, 0x0a, 0x0d, 0x52,
|
0x1d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
|
0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x30, 0x01,
|
||||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3f,
|
|
||||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e,
|
|
||||||
0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63,
|
|
||||||
0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x41, 0x63, 0x74,
|
|
||||||
0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
|
||||||
0x02, 0x38, 0x01, 0x32, 0x5b, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x43, 0x6f, 0x64, 0x65,
|
|
||||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c,
|
|
||||||
0x6c, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
|
||||||
0x73, 0x12, 0x0e, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x54, 0x69, 0x6d,
|
|
||||||
0x65, 0x1a, 0x1d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f,
|
|
||||||
0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
|
|
||||||
0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x72,
|
0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x72,
|
||||||
0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
@ -274,25 +224,21 @@ func file_promo_proto_rawDescGZIP() []byte {
|
|||||||
return file_promo_proto_rawDescData
|
return file_promo_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_promo_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
var file_promo_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
var file_promo_proto_goTypes = []interface{}{
|
var file_promo_proto_goTypes = []interface{}{
|
||||||
(*Time)(nil), // 0: codeword.Time
|
(*Time)(nil), // 0: codeword.Time
|
||||||
(*PromoActivationResp)(nil), // 1: codeword.PromoActivationResp
|
(*PromoActivationResp)(nil), // 1: codeword.PromoActivationResp
|
||||||
(*PromoActivationResp_UserTime)(nil), // 2: codeword.PromoActivationResp.UserTime
|
(*PromoActivationResp_UserTime)(nil), // 2: codeword.PromoActivationResp.UserTime
|
||||||
(*PromoActivationResp_Activations)(nil), // 3: codeword.PromoActivationResp.Activations
|
|
||||||
nil, // 4: codeword.PromoActivationResp.ResponseEntry
|
|
||||||
}
|
}
|
||||||
var file_promo_proto_depIdxs = []int32{
|
var file_promo_proto_depIdxs = []int32{
|
||||||
4, // 0: codeword.PromoActivationResp.response:type_name -> codeword.PromoActivationResp.ResponseEntry
|
2, // 0: codeword.PromoActivationResp.Users:type_name -> codeword.PromoActivationResp.UserTime
|
||||||
2, // 1: codeword.PromoActivationResp.Activations.values:type_name -> codeword.PromoActivationResp.UserTime
|
0, // 1: codeword.PromoCodeService.GetAllPromoActivations:input_type -> codeword.Time
|
||||||
3, // 2: codeword.PromoActivationResp.ResponseEntry.value:type_name -> codeword.PromoActivationResp.Activations
|
1, // 2: codeword.PromoCodeService.GetAllPromoActivations:output_type -> codeword.PromoActivationResp
|
||||||
0, // 3: codeword.PromoCodeService.GetAllPromoActivations:input_type -> codeword.Time
|
2, // [2:3] is the sub-list for method output_type
|
||||||
1, // 4: codeword.PromoCodeService.GetAllPromoActivations:output_type -> codeword.PromoActivationResp
|
1, // [1:2] is the sub-list for method input_type
|
||||||
4, // [4:5] is the sub-list for method output_type
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
3, // [3:4] is the sub-list for method input_type
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
3, // [3:3] is the sub-list for extension type_name
|
0, // [0:1] is the sub-list for field type_name
|
||||||
3, // [3:3] is the sub-list for extension extendee
|
|
||||||
0, // [0:3] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_promo_proto_init() }
|
func init() { file_promo_proto_init() }
|
||||||
@ -337,18 +283,6 @@ func file_promo_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_promo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*PromoActivationResp_Activations); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@ -356,7 +290,7 @@ func file_promo_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_promo_proto_rawDesc,
|
RawDescriptor: file_promo_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 5,
|
NumMessages: 3,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
@ -18,7 +18,7 @@ const _ = grpc.SupportPackageIsVersion7
|
|||||||
//
|
//
|
||||||
// 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.
|
// 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.
|
||||||
type PromoCodeServiceClient interface {
|
type PromoCodeServiceClient interface {
|
||||||
GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (*PromoActivationResp, error)
|
GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (PromoCodeService_GetAllPromoActivationsClient, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type promoCodeServiceClient struct {
|
type promoCodeServiceClient struct {
|
||||||
@ -29,20 +29,43 @@ func NewPromoCodeServiceClient(cc grpc.ClientConnInterface) PromoCodeServiceClie
|
|||||||
return &promoCodeServiceClient{cc}
|
return &promoCodeServiceClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *promoCodeServiceClient) GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (*PromoActivationResp, error) {
|
func (c *promoCodeServiceClient) GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (PromoCodeService_GetAllPromoActivationsClient, error) {
|
||||||
out := new(PromoActivationResp)
|
stream, err := c.cc.NewStream(ctx, &PromoCodeService_ServiceDesc.Streams[0], "/codeword.PromoCodeService/GetAllPromoActivations", opts...)
|
||||||
err := c.cc.Invoke(ctx, "/codeword.PromoCodeService/GetAllPromoActivations", in, out, opts...)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
x := &promoCodeServiceGetAllPromoActivationsClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type PromoCodeService_GetAllPromoActivationsClient interface {
|
||||||
|
Recv() (*PromoActivationResp, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type promoCodeServiceGetAllPromoActivationsClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *promoCodeServiceGetAllPromoActivationsClient) Recv() (*PromoActivationResp, error) {
|
||||||
|
m := new(PromoActivationResp)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PromoCodeServiceServer is the server API for PromoCodeService service.
|
// PromoCodeServiceServer is the server API for PromoCodeService service.
|
||||||
// All implementations must embed UnimplementedPromoCodeServiceServer
|
// All implementations must embed UnimplementedPromoCodeServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
type PromoCodeServiceServer interface {
|
type PromoCodeServiceServer interface {
|
||||||
GetAllPromoActivations(context.Context, *Time) (*PromoActivationResp, error)
|
GetAllPromoActivations(*Time, PromoCodeService_GetAllPromoActivationsServer) error
|
||||||
mustEmbedUnimplementedPromoCodeServiceServer()
|
mustEmbedUnimplementedPromoCodeServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,8 +73,8 @@ type PromoCodeServiceServer interface {
|
|||||||
type UnimplementedPromoCodeServiceServer struct {
|
type UnimplementedPromoCodeServiceServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (UnimplementedPromoCodeServiceServer) GetAllPromoActivations(context.Context, *Time) (*PromoActivationResp, error) {
|
func (UnimplementedPromoCodeServiceServer) GetAllPromoActivations(*Time, PromoCodeService_GetAllPromoActivationsServer) error {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetAllPromoActivations not implemented")
|
return status.Errorf(codes.Unimplemented, "method GetAllPromoActivations not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedPromoCodeServiceServer) mustEmbedUnimplementedPromoCodeServiceServer() {}
|
func (UnimplementedPromoCodeServiceServer) mustEmbedUnimplementedPromoCodeServiceServer() {}
|
||||||
|
|
||||||
@ -66,22 +89,25 @@ func RegisterPromoCodeServiceServer(s grpc.ServiceRegistrar, srv PromoCodeServic
|
|||||||
s.RegisterService(&PromoCodeService_ServiceDesc, srv)
|
s.RegisterService(&PromoCodeService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _PromoCodeService_GetAllPromoActivations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _PromoCodeService_GetAllPromoActivations_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
in := new(Time)
|
m := new(Time)
|
||||||
if err := dec(in); err != nil {
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
return nil, err
|
return err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
return srv.(PromoCodeServiceServer).GetAllPromoActivations(m, &promoCodeServiceGetAllPromoActivationsServer{stream})
|
||||||
return srv.(PromoCodeServiceServer).GetAllPromoActivations(ctx, in)
|
}
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
type PromoCodeService_GetAllPromoActivationsServer interface {
|
||||||
Server: srv,
|
Send(*PromoActivationResp) error
|
||||||
FullMethod: "/codeword.PromoCodeService/GetAllPromoActivations",
|
grpc.ServerStream
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(PromoCodeServiceServer).GetAllPromoActivations(ctx, req.(*Time))
|
type promoCodeServiceGetAllPromoActivationsServer struct {
|
||||||
}
|
grpc.ServerStream
|
||||||
return interceptor(ctx, in, info, handler)
|
}
|
||||||
|
|
||||||
|
func (x *promoCodeServiceGetAllPromoActivationsServer) Send(m *PromoActivationResp) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PromoCodeService_ServiceDesc is the grpc.ServiceDesc for PromoCodeService service.
|
// PromoCodeService_ServiceDesc is the grpc.ServiceDesc for PromoCodeService service.
|
||||||
@ -90,12 +116,13 @@ func _PromoCodeService_GetAllPromoActivations_Handler(srv interface{}, ctx conte
|
|||||||
var PromoCodeService_ServiceDesc = grpc.ServiceDesc{
|
var PromoCodeService_ServiceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "codeword.PromoCodeService",
|
ServiceName: "codeword.PromoCodeService",
|
||||||
HandlerType: (*PromoCodeServiceServer)(nil),
|
HandlerType: (*PromoCodeServiceServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
{
|
{
|
||||||
MethodName: "GetAllPromoActivations",
|
StreamName: "GetAllPromoActivations",
|
||||||
Handler: _PromoCodeService_GetAllPromoActivations_Handler,
|
Handler: _PromoCodeService_GetAllPromoActivations_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "promo.proto",
|
Metadata: "promo.proto",
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user