diff --git a/internal/pkg/protogen/auth/v1/service.pb.go b/internal/pkg/protogen/auth/v1/service.pb.go index 7cad732..60d84af 100644 --- a/internal/pkg/protogen/auth/v1/service.pb.go +++ b/internal/pkg/protogen/auth/v1/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/auth/v1/service.proto @@ -32,6 +32,7 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -42,18 +43,16 @@ const ( ) type GetJwksRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetJwksRequest) Reset() { *x = GetJwksRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetJwksRequest) String() string { @@ -64,7 +63,7 @@ func (*GetJwksRequest) ProtoMessage() {} func (x *GetJwksRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -80,20 +79,17 @@ func (*GetJwksRequest) Descriptor() ([]byte, []int) { } type GetJwksResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Keys []*PublicEcJWK `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` unknownFields protoimpl.UnknownFields - - Keys []*PublicEcJWK `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetJwksResponse) Reset() { *x = GetJwksResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetJwksResponse) String() string { @@ -104,7 +100,7 @@ func (*GetJwksResponse) ProtoMessage() {} func (x *GetJwksResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -127,21 +123,18 @@ func (x *GetJwksResponse) GetKeys() []*PublicEcJWK { } type LoginPasswordRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + sizeCache protoimpl.SizeCache } func (x *LoginPasswordRequest) Reset() { *x = LoginPasswordRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LoginPasswordRequest) String() string { @@ -152,7 +145,7 @@ func (*LoginPasswordRequest) ProtoMessage() {} func (x *LoginPasswordRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -182,21 +175,18 @@ func (x *LoginPasswordRequest) GetPassword() string { } type LoginPasswordResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` + Data *AuthToken `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` - Data *AuthToken `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *LoginPasswordResponse) Reset() { *x = LoginPasswordResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LoginPasswordResponse) String() string { @@ -207,7 +197,7 @@ func (*LoginPasswordResponse) ProtoMessage() {} func (x *LoginPasswordResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -237,21 +227,18 @@ func (x *LoginPasswordResponse) GetData() *AuthToken { } type SetPasswordRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SetPasswordRequest) Reset() { *x = SetPasswordRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SetPasswordRequest) String() string { @@ -262,7 +249,7 @@ func (*SetPasswordRequest) ProtoMessage() {} func (x *SetPasswordRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -292,20 +279,17 @@ func (x *SetPasswordRequest) GetPassword() string { } type SetPasswordResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` unknownFields protoimpl.UnknownFields - - Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` + sizeCache protoimpl.SizeCache } func (x *SetPasswordResponse) Reset() { *x = SetPasswordResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SetPasswordResponse) String() string { @@ -316,7 +300,7 @@ func (*SetPasswordResponse) ProtoMessage() {} func (x *SetPasswordResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -340,111 +324,45 @@ func (x *SetPasswordResponse) GetDetail() string { var File_stocklet_auth_v1_service_proto protoreflect.FileDescriptor -var file_stocklet_auth_v1_service_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x10, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, - 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4a, - 0x77, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x44, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x4a, 0x77, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, - 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x45, 0x63, 0x4a, 0x57, 0x4b, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, - 0x22, 0x65, 0x0a, 0x14, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xe0, 0x41, 0x02, 0xba, 0x48, - 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, - 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x40, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x60, 0x0a, 0x15, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x63, 0x0a, 0x12, 0x53, 0x65, 0x74, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x23, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0a, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04, - 0x10, 0x01, 0x18, 0x40, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2d, - 0x0a, 0x13, 0x53, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x32, 0xd0, 0x04, - 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, - 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4a, 0x77, - 0x6b, 0x73, 0x12, 0x20, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x77, 0x6b, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x77, 0x6b, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, - 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6a, 0x77, 0x6b, 0x73, 0x12, 0x7b, - 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x78, 0x0a, 0x0b, 0x53, - 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, - 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, - 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x69, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, - 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, - 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, - 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, - 0x74, 0x68, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_auth_v1_service_proto_rawDesc = "" + + "\n" + + "\x1estocklet/auth/v1/service.proto\x12\x10stocklet.auth.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cstocklet/auth/v1/types.proto\x1a!stocklet/common/v1/requests.proto\x1a\x1dstocklet/events/v1/user.proto\"\x10\n" + + "\x0eGetJwksRequest\"D\n" + + "\x0fGetJwksResponse\x121\n" + + "\x04keys\x18\x01 \x03(\v2\x1d.stocklet.auth.v1.PublicEcJWKR\x04keys\"g\n" + + "\x14LoginPasswordRequest\x12$\n" + + "\auser_id\x18\x01 \x01(\tB\v\xe2A\x01\x02\xbaH\x04r\x02\x10\x01R\x06userId\x12)\n" + + "\bpassword\x18\x02 \x01(\tB\r\xe2A\x01\x02\xbaH\x06r\x04\x10\x01\x18@R\bpassword\"`\n" + + "\x15LoginPasswordResponse\x12\x16\n" + + "\x06detail\x18\x01 \x01(\tR\x06detail\x12/\n" + + "\x04data\x18\x02 \x01(\v2\x1b.stocklet.auth.v1.AuthTokenR\x04data\"e\n" + + "\x12SetPasswordRequest\x12$\n" + + "\auser_id\x18\x01 \x01(\tB\v\xe2A\x01\x02\xbaH\x04r\x02\x10\x01R\x06userId\x12)\n" + + "\bpassword\x18\x02 \x01(\tB\r\xe2A\x01\x02\xbaH\x06r\x04\x10\x01\x18@R\bpassword\"-\n" + + "\x13SetPasswordResponse\x12\x16\n" + + "\x06detail\x18\x01 \x01(\tR\x06detail2\xd0\x04\n" + + "\vAuthService\x12x\n" + + "\vServiceInfo\x12&.stocklet.common.v1.ServiceInfoRequest\x1a'.stocklet.common.v1.ServiceInfoResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/auth/service\x12e\n" + + "\aGetJwks\x12 .stocklet.auth.v1.GetJwksRequest\x1a!.stocklet.auth.v1.GetJwksResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/v1/auth/jwks\x12{\n" + + "\rLoginPassword\x12&.stocklet.auth.v1.LoginPasswordRequest\x1a'.stocklet.auth.v1.LoginPasswordResponse\"\x19\x82\xd3\xe4\x93\x02\x13:\x01*\"\x0e/v1/auth/login\x12x\n" + + "\vSetPassword\x12$.stocklet.auth.v1.SetPasswordRequest\x1a%.stocklet.auth.v1.SetPasswordResponse\"\x1c\x82\xd3\xe4\x93\x02\x16:\x01*\"\x11/v1/auth/password\x12i\n" + + "\x17ProcessUserDeletedEvent\x12$.stocklet.events.v1.UserDeletedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNALBCZAgithub.com/hexolan/stocklet/internal/pkg/protogen/auth/v1;auth_v1b\x06proto3" var ( file_stocklet_auth_v1_service_proto_rawDescOnce sync.Once - file_stocklet_auth_v1_service_proto_rawDescData = file_stocklet_auth_v1_service_proto_rawDesc + file_stocklet_auth_v1_service_proto_rawDescData []byte ) func file_stocklet_auth_v1_service_proto_rawDescGZIP() []byte { file_stocklet_auth_v1_service_proto_rawDescOnce.Do(func() { - file_stocklet_auth_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_auth_v1_service_proto_rawDescData) + file_stocklet_auth_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_auth_v1_service_proto_rawDesc), len(file_stocklet_auth_v1_service_proto_rawDesc))) }) return file_stocklet_auth_v1_service_proto_rawDescData } var file_stocklet_auth_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_stocklet_auth_v1_service_proto_goTypes = []interface{}{ +var file_stocklet_auth_v1_service_proto_goTypes = []any{ (*GetJwksRequest)(nil), // 0: stocklet.auth.v1.GetJwksRequest (*GetJwksResponse)(nil), // 1: stocklet.auth.v1.GetJwksResponse (*LoginPasswordRequest)(nil), // 2: stocklet.auth.v1.LoginPasswordRequest @@ -484,85 +402,11 @@ func file_stocklet_auth_v1_service_proto_init() { return } file_stocklet_auth_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_stocklet_auth_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJwksRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_auth_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJwksResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_auth_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginPasswordRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_auth_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginPasswordResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_auth_v1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetPasswordRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_auth_v1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetPasswordResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_auth_v1_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_auth_v1_service_proto_rawDesc), len(file_stocklet_auth_v1_service_proto_rawDesc)), NumEnums: 0, NumMessages: 6, NumExtensions: 0, @@ -573,7 +417,6 @@ func file_stocklet_auth_v1_service_proto_init() { MessageInfos: file_stocklet_auth_v1_service_proto_msgTypes, }.Build() File_stocklet_auth_v1_service_proto = out.File - file_stocklet_auth_v1_service_proto_rawDesc = nil file_stocklet_auth_v1_service_proto_goTypes = nil file_stocklet_auth_v1_service_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/auth/v1/service.pb.gw.go b/internal/pkg/protogen/auth/v1/service.pb.gw.go index cc4ec53..927ddf8 100644 --- a/internal/pkg/protogen/auth/v1/service.pb.gw.go +++ b/internal/pkg/protogen/auth/v1/service.pb.gw.go @@ -10,6 +10,7 @@ package auth_v1 import ( "context" + "errors" "io" "net/http" @@ -25,132 +26,125 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_AuthService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AuthService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) msg, err := server.ServiceInfo(ctx, &protoReq) return msg, metadata, err - } func request_AuthService_GetJwks_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetJwksRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetJwksRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.GetJwks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AuthService_GetJwks_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetJwksRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetJwksRequest + metadata runtime.ServerMetadata + ) msg, err := server.GetJwks(ctx, &protoReq) return msg, metadata, err - } func request_AuthService_LoginPassword_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoginPasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq LoginPasswordRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.LoginPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AuthService_LoginPassword_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoginPasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq LoginPasswordRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.LoginPassword(ctx, &protoReq) return msg, metadata, err - } func request_AuthService_SetPassword_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetPasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq SetPasswordRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.SetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_AuthService_SetPassword_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetPasswordRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq SetPasswordRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.SetPassword(ctx, &protoReq) return msg, metadata, err - } // RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". // UnaryRPC :call AuthServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error { - - mux.Handle("GET", pattern_AuthService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AuthService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/auth/service")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/auth/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -162,20 +156,15 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_AuthService_GetJwks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AuthService_GetJwks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/GetJwks", runtime.WithHTTPPathPattern("/v1/auth/jwks")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/GetJwks", runtime.WithHTTPPathPattern("/v1/auth/jwks")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -187,20 +176,15 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_GetJwks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AuthService_LoginPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AuthService_LoginPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/LoginPassword", runtime.WithHTTPPathPattern("/v1/auth/login")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/LoginPassword", runtime.WithHTTPPathPattern("/v1/auth/login")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -212,20 +196,15 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_LoginPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AuthService_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AuthService_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/SetPassword", runtime.WithHTTPPathPattern("/v1/auth/password")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/SetPassword", runtime.WithHTTPPathPattern("/v1/auth/password")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -237,9 +216,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_SetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -248,25 +225,24 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux // RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterAuthServiceHandler(ctx, mux, conn) } @@ -280,16 +256,13 @@ func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AuthServiceClient" to call the correct interceptors. +// "AuthServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error { - - mux.Handle("GET", pattern_AuthService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AuthService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/auth/service")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/auth/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -300,18 +273,13 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_AuthService_GetJwks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_AuthService_GetJwks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/GetJwks", runtime.WithHTTPPathPattern("/v1/auth/jwks")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/GetJwks", runtime.WithHTTPPathPattern("/v1/auth/jwks")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -322,18 +290,13 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_GetJwks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AuthService_LoginPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AuthService_LoginPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/LoginPassword", runtime.WithHTTPPathPattern("/v1/auth/login")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/LoginPassword", runtime.WithHTTPPathPattern("/v1/auth/login")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -344,18 +307,13 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_LoginPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_AuthService_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_AuthService_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/SetPassword", runtime.WithHTTPPathPattern("/v1/auth/password")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/SetPassword", runtime.WithHTTPPathPattern("/v1/auth/password")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -366,30 +324,21 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_AuthService_SetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_AuthService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "service"}, "")) - - pattern_AuthService_GetJwks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "jwks"}, "")) - + pattern_AuthService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "service"}, "")) + pattern_AuthService_GetJwks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "jwks"}, "")) pattern_AuthService_LoginPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "login"}, "")) - - pattern_AuthService_SetPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "password"}, "")) + pattern_AuthService_SetPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "password"}, "")) ) var ( - forward_AuthService_ServiceInfo_0 = runtime.ForwardResponseMessage - - forward_AuthService_GetJwks_0 = runtime.ForwardResponseMessage - + forward_AuthService_ServiceInfo_0 = runtime.ForwardResponseMessage + forward_AuthService_GetJwks_0 = runtime.ForwardResponseMessage forward_AuthService_LoginPassword_0 = runtime.ForwardResponseMessage - - forward_AuthService_SetPassword_0 = runtime.ForwardResponseMessage + forward_AuthService_SetPassword_0 = runtime.ForwardResponseMessage ) diff --git a/internal/pkg/protogen/auth/v1/service_grpc.pb.go b/internal/pkg/protogen/auth/v1/service_grpc.pb.go index c284114..e1be55e 100644 --- a/internal/pkg/protogen/auth/v1/service_grpc.pb.go +++ b/internal/pkg/protogen/auth/v1/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: stocklet/auth/v1/service.proto @@ -33,8 +33,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( AuthService_ServiceInfo_FullMethodName = "/stocklet.auth.v1.AuthService/ServiceInfo" @@ -72,8 +72,9 @@ func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { } func (c *authServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v1.ServiceInfoResponse) - err := c.cc.Invoke(ctx, AuthService_ServiceInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, AuthService_ServiceInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,8 +82,9 @@ func (c *authServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoR } func (c *authServiceClient) GetJwks(ctx context.Context, in *GetJwksRequest, opts ...grpc.CallOption) (*GetJwksResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetJwksResponse) - err := c.cc.Invoke(ctx, AuthService_GetJwks_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, AuthService_GetJwks_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -90,8 +92,9 @@ func (c *authServiceClient) GetJwks(ctx context.Context, in *GetJwksRequest, opt } func (c *authServiceClient) LoginPassword(ctx context.Context, in *LoginPasswordRequest, opts ...grpc.CallOption) (*LoginPasswordResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(LoginPasswordResponse) - err := c.cc.Invoke(ctx, AuthService_LoginPassword_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, AuthService_LoginPassword_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -99,8 +102,9 @@ func (c *authServiceClient) LoginPassword(ctx context.Context, in *LoginPassword } func (c *authServiceClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*SetPasswordResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SetPasswordResponse) - err := c.cc.Invoke(ctx, AuthService_SetPassword_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, AuthService_SetPassword_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -108,8 +112,9 @@ func (c *authServiceClient) SetPassword(ctx context.Context, in *SetPasswordRequ } func (c *authServiceClient) ProcessUserDeletedEvent(ctx context.Context, in *v11.UserDeletedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, AuthService_ProcessUserDeletedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, AuthService_ProcessUserDeletedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -118,7 +123,7 @@ func (c *authServiceClient) ProcessUserDeletedEvent(ctx context.Context, in *v11 // AuthServiceServer is the server API for AuthService service. // All implementations must embed UnimplementedAuthServiceServer -// for forward compatibility +// for forward compatibility. type AuthServiceServer interface { // View information about the service. // @@ -136,26 +141,30 @@ type AuthServiceServer interface { mustEmbedUnimplementedAuthServiceServer() } -// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAuthServiceServer struct { -} +// UnimplementedAuthServiceServer 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 UnimplementedAuthServiceServer struct{} func (UnimplementedAuthServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method ServiceInfo not implemented") } func (UnimplementedAuthServiceServer) GetJwks(context.Context, *GetJwksRequest) (*GetJwksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetJwks not implemented") + return nil, status.Error(codes.Unimplemented, "method GetJwks not implemented") } func (UnimplementedAuthServiceServer) LoginPassword(context.Context, *LoginPasswordRequest) (*LoginPasswordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LoginPassword not implemented") + return nil, status.Error(codes.Unimplemented, "method LoginPassword not implemented") } func (UnimplementedAuthServiceServer) SetPassword(context.Context, *SetPasswordRequest) (*SetPasswordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented") + return nil, status.Error(codes.Unimplemented, "method SetPassword not implemented") } func (UnimplementedAuthServiceServer) ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessUserDeletedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessUserDeletedEvent not implemented") } func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} +func (UnimplementedAuthServiceServer) testEmbeddedByValue() {} // UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AuthServiceServer will @@ -165,6 +174,13 @@ type UnsafeAuthServiceServer interface { } func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { + // If the following call panics, it indicates UnimplementedAuthServiceServer 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(&AuthService_ServiceDesc, srv) } diff --git a/internal/pkg/protogen/auth/v1/types.pb.go b/internal/pkg/protogen/auth/v1/types.pb.go index a540dd6..9f76ff2 100644 --- a/internal/pkg/protogen/auth/v1/types.pb.go +++ b/internal/pkg/protogen/auth/v1/types.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/auth/v1/types.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -36,25 +37,22 @@ const ( ) type PublicEcJWK struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` + Use string `protobuf:"bytes,2,opt,name=use,proto3" json:"use,omitempty"` + Alg string `protobuf:"bytes,3,opt,name=alg,proto3" json:"alg,omitempty"` + Crv string `protobuf:"bytes,4,opt,name=crv,proto3" json:"crv,omitempty"` + X string `protobuf:"bytes,5,opt,name=x,proto3" json:"x,omitempty"` + Y string `protobuf:"bytes,6,opt,name=y,proto3" json:"y,omitempty"` unknownFields protoimpl.UnknownFields - - Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` - Use string `protobuf:"bytes,2,opt,name=use,proto3" json:"use,omitempty"` - Alg string `protobuf:"bytes,3,opt,name=alg,proto3" json:"alg,omitempty"` - Crv string `protobuf:"bytes,4,opt,name=crv,proto3" json:"crv,omitempty"` - X string `protobuf:"bytes,5,opt,name=x,proto3" json:"x,omitempty"` - Y string `protobuf:"bytes,6,opt,name=y,proto3" json:"y,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PublicEcJWK) Reset() { *x = PublicEcJWK{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PublicEcJWK) String() string { @@ -65,7 +63,7 @@ func (*PublicEcJWK) ProtoMessage() {} func (x *PublicEcJWK) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -123,22 +121,19 @@ func (x *PublicEcJWK) GetY() string { } type AuthToken struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + TokenType string `protobuf:"bytes,1,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + ExpiresIn int64 `protobuf:"varint,3,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` unknownFields protoimpl.UnknownFields - - TokenType string `protobuf:"bytes,1,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` - AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - ExpiresIn int64 `protobuf:"varint,3,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` + sizeCache protoimpl.SizeCache } func (x *AuthToken) Reset() { *x = AuthToken{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_auth_v1_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_auth_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AuthToken) String() string { @@ -149,7 +144,7 @@ func (*AuthToken) ProtoMessage() {} func (x *AuthToken) ProtoReflect() protoreflect.Message { mi := &file_stocklet_auth_v1_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -187,45 +182,37 @@ func (x *AuthToken) GetExpiresIn() int64 { var File_stocklet_auth_v1_types_proto protoreflect.FileDescriptor -var file_stocklet_auth_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x22, 0x71, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x45, 0x63, 0x4a, 0x57, 0x4b, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x61, 0x6c, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x01, 0x79, 0x22, 0x6c, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x69, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, - 0x6e, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x3b, 0x61, - 0x75, 0x74, 0x68, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_auth_v1_types_proto_rawDesc = "" + + "\n" + + "\x1cstocklet/auth/v1/types.proto\x12\x10stocklet.auth.v1\"q\n" + + "\vPublicEcJWK\x12\x10\n" + + "\x03kty\x18\x01 \x01(\tR\x03kty\x12\x10\n" + + "\x03use\x18\x02 \x01(\tR\x03use\x12\x10\n" + + "\x03alg\x18\x03 \x01(\tR\x03alg\x12\x10\n" + + "\x03crv\x18\x04 \x01(\tR\x03crv\x12\f\n" + + "\x01x\x18\x05 \x01(\tR\x01x\x12\f\n" + + "\x01y\x18\x06 \x01(\tR\x01y\"l\n" + + "\tAuthToken\x12\x1d\n" + + "\n" + + "token_type\x18\x01 \x01(\tR\ttokenType\x12!\n" + + "\faccess_token\x18\x02 \x01(\tR\vaccessToken\x12\x1d\n" + + "\n" + + "expires_in\x18\x03 \x01(\x03R\texpiresInBCZAgithub.com/hexolan/stocklet/internal/pkg/protogen/auth/v1;auth_v1b\x06proto3" var ( file_stocklet_auth_v1_types_proto_rawDescOnce sync.Once - file_stocklet_auth_v1_types_proto_rawDescData = file_stocklet_auth_v1_types_proto_rawDesc + file_stocklet_auth_v1_types_proto_rawDescData []byte ) func file_stocklet_auth_v1_types_proto_rawDescGZIP() []byte { file_stocklet_auth_v1_types_proto_rawDescOnce.Do(func() { - file_stocklet_auth_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_auth_v1_types_proto_rawDescData) + file_stocklet_auth_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_auth_v1_types_proto_rawDesc), len(file_stocklet_auth_v1_types_proto_rawDesc))) }) return file_stocklet_auth_v1_types_proto_rawDescData } var file_stocklet_auth_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stocklet_auth_v1_types_proto_goTypes = []interface{}{ +var file_stocklet_auth_v1_types_proto_goTypes = []any{ (*PublicEcJWK)(nil), // 0: stocklet.auth.v1.PublicEcJWK (*AuthToken)(nil), // 1: stocklet.auth.v1.AuthToken } @@ -242,37 +229,11 @@ func file_stocklet_auth_v1_types_proto_init() { if File_stocklet_auth_v1_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_auth_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublicEcJWK); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_auth_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthToken); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_auth_v1_types_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_auth_v1_types_proto_rawDesc), len(file_stocklet_auth_v1_types_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -283,7 +244,6 @@ func file_stocklet_auth_v1_types_proto_init() { MessageInfos: file_stocklet_auth_v1_types_proto_msgTypes, }.Build() File_stocklet_auth_v1_types_proto = out.File - file_stocklet_auth_v1_types_proto_rawDesc = nil file_stocklet_auth_v1_types_proto_goTypes = nil file_stocklet_auth_v1_types_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/common/v1/requests.pb.go b/internal/pkg/protogen/common/v1/requests.pb.go index 32ed4f0..3de41c2 100644 --- a/internal/pkg/protogen/common/v1/requests.pb.go +++ b/internal/pkg/protogen/common/v1/requests.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/common/v1/requests.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -36,18 +37,16 @@ const ( ) type ServiceInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ServiceInfoRequest) Reset() { *x = ServiceInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_common_v1_requests_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_common_v1_requests_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ServiceInfoRequest) String() string { @@ -58,7 +57,7 @@ func (*ServiceInfoRequest) ProtoMessage() {} func (x *ServiceInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_common_v1_requests_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -74,22 +73,19 @@ func (*ServiceInfoRequest) Descriptor() ([]byte, []int) { } type ServiceInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` + SourceLicense string `protobuf:"bytes,3,opt,name=source_license,json=sourceLicense,proto3" json:"source_license,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - SourceLicense string `protobuf:"bytes,3,opt,name=source_license,json=sourceLicense,proto3" json:"source_license,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ServiceInfoResponse) Reset() { *x = ServiceInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_common_v1_requests_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_common_v1_requests_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ServiceInfoResponse) String() string { @@ -100,7 +96,7 @@ func (*ServiceInfoResponse) ProtoMessage() {} func (x *ServiceInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_common_v1_requests_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -138,40 +134,29 @@ func (x *ServiceInfoResponse) GetSourceLicense() string { var File_stocklet_common_v1_requests_proto protoreflect.FileDescriptor -var file_stocklet_common_v1_requests_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, - 0x13, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x63, 0x65, 0x6e, - 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_common_v1_requests_proto_rawDesc = "" + + "\n" + + "!stocklet/common/v1/requests.proto\x12\x12stocklet.common.v1\"\x14\n" + + "\x12ServiceInfoRequest\"h\n" + + "\x13ServiceInfoResponse\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + + "\x06source\x18\x02 \x01(\tR\x06source\x12%\n" + + "\x0esource_license\x18\x03 \x01(\tR\rsourceLicenseBGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/common/v1;common_v1b\x06proto3" var ( file_stocklet_common_v1_requests_proto_rawDescOnce sync.Once - file_stocklet_common_v1_requests_proto_rawDescData = file_stocklet_common_v1_requests_proto_rawDesc + file_stocklet_common_v1_requests_proto_rawDescData []byte ) func file_stocklet_common_v1_requests_proto_rawDescGZIP() []byte { file_stocklet_common_v1_requests_proto_rawDescOnce.Do(func() { - file_stocklet_common_v1_requests_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_common_v1_requests_proto_rawDescData) + file_stocklet_common_v1_requests_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_common_v1_requests_proto_rawDesc), len(file_stocklet_common_v1_requests_proto_rawDesc))) }) return file_stocklet_common_v1_requests_proto_rawDescData } var file_stocklet_common_v1_requests_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stocklet_common_v1_requests_proto_goTypes = []interface{}{ +var file_stocklet_common_v1_requests_proto_goTypes = []any{ (*ServiceInfoRequest)(nil), // 0: stocklet.common.v1.ServiceInfoRequest (*ServiceInfoResponse)(nil), // 1: stocklet.common.v1.ServiceInfoResponse } @@ -188,37 +173,11 @@ func file_stocklet_common_v1_requests_proto_init() { if File_stocklet_common_v1_requests_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_common_v1_requests_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_common_v1_requests_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_common_v1_requests_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_common_v1_requests_proto_rawDesc), len(file_stocklet_common_v1_requests_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -229,7 +188,6 @@ func file_stocklet_common_v1_requests_proto_init() { MessageInfos: file_stocklet_common_v1_requests_proto_msgTypes, }.Build() File_stocklet_common_v1_requests_proto = out.File - file_stocklet_common_v1_requests_proto_rawDesc = nil file_stocklet_common_v1_requests_proto_goTypes = nil file_stocklet_common_v1_requests_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/events/v1/order.pb.go b/internal/pkg/protogen/events/v1/order.pb.go index 5395c7c..b466109 100644 --- a/internal/pkg/protogen/events/v1/order.pb.go +++ b/internal/pkg/protogen/events/v1/order.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/events/v1/order.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -37,23 +38,20 @@ const ( // Order Status = processing type OrderCreatedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - ItemQuantities map[string]int32 `protobuf:"bytes,4,rep,name=item_quantities,json=itemQuantities,proto3" json:"item_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + ItemQuantities map[string]int32 `protobuf:"bytes,4,rep,name=item_quantities,json=itemQuantities,proto3" json:"item_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *OrderCreatedEvent) Reset() { *x = OrderCreatedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_order_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_order_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OrderCreatedEvent) String() string { @@ -64,7 +62,7 @@ func (*OrderCreatedEvent) ProtoMessage() {} func (x *OrderCreatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_order_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -109,25 +107,22 @@ func (x *OrderCreatedEvent) GetItemQuantities() map[string]int32 { // Order Status = pending type OrderPendingEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - ItemQuantities map[string]int32 `protobuf:"bytes,4,rep,name=item_quantities,json=itemQuantities,proto3" json:"item_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - ItemsPrice float32 `protobuf:"fixed32,5,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"` - TotalPrice float32 `protobuf:"fixed32,6,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + ItemQuantities map[string]int32 `protobuf:"bytes,4,rep,name=item_quantities,json=itemQuantities,proto3" json:"item_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + ItemsPrice float32 `protobuf:"fixed32,5,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"` + TotalPrice float32 `protobuf:"fixed32,6,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *OrderPendingEvent) Reset() { *x = OrderPendingEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_order_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_order_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OrderPendingEvent) String() string { @@ -138,7 +133,7 @@ func (*OrderPendingEvent) ProtoMessage() {} func (x *OrderPendingEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_order_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -197,23 +192,20 @@ func (x *OrderPendingEvent) GetTotalPrice() float32 { // Order Status = rejected type OrderRejectedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + TransactionId *string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"` + ShippingId *string `protobuf:"bytes,4,opt,name=shipping_id,json=shippingId,proto3,oneof" json:"shipping_id,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - TransactionId *string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"` - ShippingId *string `protobuf:"bytes,4,opt,name=shipping_id,json=shippingId,proto3,oneof" json:"shipping_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *OrderRejectedEvent) Reset() { *x = OrderRejectedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_order_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_order_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OrderRejectedEvent) String() string { @@ -224,7 +216,7 @@ func (*OrderRejectedEvent) ProtoMessage() {} func (x *OrderRejectedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_order_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -269,23 +261,20 @@ func (x *OrderRejectedEvent) GetShippingId() string { // Order Status = approved type OrderApprovedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + TransactionId string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + ShippingId string `protobuf:"bytes,4,opt,name=shipping_id,json=shippingId,proto3" json:"shipping_id,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - TransactionId string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - ShippingId string `protobuf:"bytes,4,opt,name=shipping_id,json=shippingId,proto3" json:"shipping_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *OrderApprovedEvent) Reset() { *x = OrderApprovedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_order_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_order_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OrderApprovedEvent) String() string { @@ -296,7 +285,7 @@ func (*OrderApprovedEvent) ProtoMessage() {} func (x *OrderApprovedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_order_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -341,92 +330,60 @@ func (x *OrderApprovedEvent) GetShippingId() string { var File_stocklet_events_v1_order_proto protoreflect.FileDescriptor -var file_stocklet_events_v1_order_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x22, 0x92, 0x02, 0x0a, 0x11, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x62, 0x0a, 0x0f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd4, 0x02, 0x0a, 0x11, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x62, 0x0a, 0x0f, 0x69, 0x74, 0x65, 0x6d, 0x5f, - 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x39, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x74, 0x65, - 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, - 0x52, 0x0a, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x1a, 0x41, 0x0a, - 0x13, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0xc0, 0x01, 0x0a, 0x12, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, - 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x73, 0x68, - 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x01, 0x52, 0x0a, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x88, 0x01, 0x01, - 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x5f, 0x69, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x70, 0x70, - 0x72, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, - 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, - 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_events_v1_order_proto_rawDesc = "" + + "\n" + + "\x1estocklet/events/v1/order.proto\x12\x12stocklet.events.v1\"\x92\x02\n" + + "\x11OrderCreatedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x19\n" + + "\border_id\x18\x02 \x01(\tR\aorderId\x12\x1f\n" + + "\vcustomer_id\x18\x03 \x01(\tR\n" + + "customerId\x12b\n" + + "\x0fitem_quantities\x18\x04 \x03(\v29.stocklet.events.v1.OrderCreatedEvent.ItemQuantitiesEntryR\x0eitemQuantities\x1aA\n" + + "\x13ItemQuantitiesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"\xd4\x02\n" + + "\x11OrderPendingEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x19\n" + + "\border_id\x18\x02 \x01(\tR\aorderId\x12\x1f\n" + + "\vcustomer_id\x18\x03 \x01(\tR\n" + + "customerId\x12b\n" + + "\x0fitem_quantities\x18\x04 \x03(\v29.stocklet.events.v1.OrderPendingEvent.ItemQuantitiesEntryR\x0eitemQuantities\x12\x1f\n" + + "\vitems_price\x18\x05 \x01(\x02R\n" + + "itemsPrice\x12\x1f\n" + + "\vtotal_price\x18\x06 \x01(\x02R\n" + + "totalPrice\x1aA\n" + + "\x13ItemQuantitiesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"\xc0\x01\n" + + "\x12OrderRejectedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x19\n" + + "\border_id\x18\x02 \x01(\tR\aorderId\x12*\n" + + "\x0etransaction_id\x18\x03 \x01(\tH\x00R\rtransactionId\x88\x01\x01\x12$\n" + + "\vshipping_id\x18\x04 \x01(\tH\x01R\n" + + "shippingId\x88\x01\x01B\x11\n" + + "\x0f_transaction_idB\x0e\n" + + "\f_shipping_id\"\x93\x01\n" + + "\x12OrderApprovedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x19\n" + + "\border_id\x18\x02 \x01(\tR\aorderId\x12%\n" + + "\x0etransaction_id\x18\x03 \x01(\tR\rtransactionId\x12\x1f\n" + + "\vshipping_id\x18\x04 \x01(\tR\n" + + "shippingIdBGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3" var ( file_stocklet_events_v1_order_proto_rawDescOnce sync.Once - file_stocklet_events_v1_order_proto_rawDescData = file_stocklet_events_v1_order_proto_rawDesc + file_stocklet_events_v1_order_proto_rawDescData []byte ) func file_stocklet_events_v1_order_proto_rawDescGZIP() []byte { file_stocklet_events_v1_order_proto_rawDescOnce.Do(func() { - file_stocklet_events_v1_order_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_order_proto_rawDescData) + file_stocklet_events_v1_order_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_order_proto_rawDesc), len(file_stocklet_events_v1_order_proto_rawDesc))) }) return file_stocklet_events_v1_order_proto_rawDescData } var file_stocklet_events_v1_order_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_stocklet_events_v1_order_proto_goTypes = []interface{}{ +var file_stocklet_events_v1_order_proto_goTypes = []any{ (*OrderCreatedEvent)(nil), // 0: stocklet.events.v1.OrderCreatedEvent (*OrderPendingEvent)(nil), // 1: stocklet.events.v1.OrderPendingEvent (*OrderRejectedEvent)(nil), // 2: stocklet.events.v1.OrderRejectedEvent @@ -449,62 +406,12 @@ func file_stocklet_events_v1_order_proto_init() { if File_stocklet_events_v1_order_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_events_v1_order_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderCreatedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_order_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderPendingEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_order_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderRejectedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_order_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderApprovedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_events_v1_order_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_stocklet_events_v1_order_proto_msgTypes[2].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_events_v1_order_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_order_proto_rawDesc), len(file_stocklet_events_v1_order_proto_rawDesc)), NumEnums: 0, NumMessages: 6, NumExtensions: 0, @@ -515,7 +422,6 @@ func file_stocklet_events_v1_order_proto_init() { MessageInfos: file_stocklet_events_v1_order_proto_msgTypes, }.Build() File_stocklet_events_v1_order_proto = out.File - file_stocklet_events_v1_order_proto_rawDesc = nil file_stocklet_events_v1_order_proto_goTypes = nil file_stocklet_events_v1_order_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/events/v1/payment.pb.go b/internal/pkg/protogen/events/v1/payment.pb.go index eb688ef..0fb2b3c 100644 --- a/internal/pkg/protogen/events/v1/payment.pb.go +++ b/internal/pkg/protogen/events/v1/payment.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/events/v1/payment.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -85,22 +86,19 @@ func (PaymentProcessedEvent_Type) EnumDescriptor() ([]byte, []int) { } type BalanceCreatedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + Balance float32 `protobuf:"fixed32,3,opt,name=balance,proto3" json:"balance,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - Balance float32 `protobuf:"fixed32,3,opt,name=balance,proto3" json:"balance,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BalanceCreatedEvent) Reset() { *x = BalanceCreatedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_payment_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_payment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BalanceCreatedEvent) String() string { @@ -111,7 +109,7 @@ func (*BalanceCreatedEvent) ProtoMessage() {} func (x *BalanceCreatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_payment_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -148,23 +146,20 @@ func (x *BalanceCreatedEvent) GetBalance() float32 { } type BalanceCreditedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` + NewBalance float32 `protobuf:"fixed32,4,opt,name=new_balance,json=newBalance,proto3" json:"new_balance,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` - NewBalance float32 `protobuf:"fixed32,4,opt,name=new_balance,json=newBalance,proto3" json:"new_balance,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BalanceCreditedEvent) Reset() { *x = BalanceCreditedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_payment_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_payment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BalanceCreditedEvent) String() string { @@ -175,7 +170,7 @@ func (*BalanceCreditedEvent) ProtoMessage() {} func (x *BalanceCreditedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_payment_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -219,23 +214,20 @@ func (x *BalanceCreditedEvent) GetNewBalance() float32 { } type BalanceDebitedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` + NewBalance float32 `protobuf:"fixed32,4,opt,name=new_balance,json=newBalance,proto3" json:"new_balance,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` - NewBalance float32 `protobuf:"fixed32,4,opt,name=new_balance,json=newBalance,proto3" json:"new_balance,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BalanceDebitedEvent) Reset() { *x = BalanceDebitedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_payment_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_payment_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BalanceDebitedEvent) String() string { @@ -246,7 +238,7 @@ func (*BalanceDebitedEvent) ProtoMessage() {} func (x *BalanceDebitedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_payment_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -290,22 +282,19 @@ func (x *BalanceDebitedEvent) GetNewBalance() float32 { } type BalanceClosedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + Balance float32 `protobuf:"fixed32,3,opt,name=balance,proto3" json:"balance,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - Balance float32 `protobuf:"fixed32,3,opt,name=balance,proto3" json:"balance,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BalanceClosedEvent) Reset() { *x = BalanceClosedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_payment_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_payment_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BalanceClosedEvent) String() string { @@ -316,7 +305,7 @@ func (*BalanceClosedEvent) ProtoMessage() {} func (x *BalanceClosedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_payment_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -353,24 +342,21 @@ func (x *BalanceClosedEvent) GetBalance() float32 { } type TransactionLoggedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + TransactionId string `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` + OrderId string `protobuf:"bytes,4,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + CustomerId string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - TransactionId string `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` - OrderId string `protobuf:"bytes,4,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - CustomerId string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionLoggedEvent) Reset() { *x = TransactionLoggedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_payment_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_payment_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionLoggedEvent) String() string { @@ -381,7 +367,7 @@ func (*TransactionLoggedEvent) ProtoMessage() {} func (x *TransactionLoggedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_payment_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -432,24 +418,21 @@ func (x *TransactionLoggedEvent) GetCustomerId() string { } type TransactionReversedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + TransactionId string `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` + OrderId string `protobuf:"bytes,4,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + CustomerId string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - TransactionId string `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"` - OrderId string `protobuf:"bytes,4,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - CustomerId string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TransactionReversedEvent) Reset() { *x = TransactionReversedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_payment_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_payment_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionReversedEvent) String() string { @@ -460,7 +443,7 @@ func (*TransactionReversedEvent) ProtoMessage() {} func (x *TransactionReversedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_payment_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -511,25 +494,22 @@ func (x *TransactionReversedEvent) GetCustomerId() string { } type PaymentProcessedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` Type PaymentProcessedEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.PaymentProcessedEvent_Type" json:"type,omitempty"` OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` Amount float32 `protobuf:"fixed32,5,opt,name=amount,proto3" json:"amount,omitempty"` TransactionId *string `protobuf:"bytes,6,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PaymentProcessedEvent) Reset() { *x = PaymentProcessedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_payment_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_payment_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PaymentProcessedEvent) String() string { @@ -540,7 +520,7 @@ func (*PaymentProcessedEvent) ProtoMessage() {} func (x *PaymentProcessedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_payment_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -599,108 +579,76 @@ func (x *PaymentProcessedEvent) GetTransactionId() string { var File_stocklet_events_v1_payment_proto protoreflect.FileDescriptor -var file_stocklet_events_v1_payment_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x6c, 0x0a, 0x13, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x14, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, - 0x65, 0x62, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x22, 0x6b, 0x0a, 0x12, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x6f, 0x73, - 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xaf, - 0x01, 0x0a, 0x16, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, - 0x67, 0x67, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, - 0x22, 0xb1, 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x65, 0x72, 0x49, 0x64, 0x22, 0xcb, 0x02, 0x0a, 0x15, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, - 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x22, 0x3f, - 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, - 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x02, 0x42, - 0x11, 0x0a, 0x0f, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, - 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_stocklet_events_v1_payment_proto_rawDesc = "" + + "\n" + + " stocklet/events/v1/payment.proto\x12\x12stocklet.events.v1\"l\n" + + "\x13BalanceCreatedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1f\n" + + "\vcustomer_id\x18\x02 \x01(\tR\n" + + "customerId\x12\x18\n" + + "\abalance\x18\x03 \x01(\x02R\abalance\"\x8c\x01\n" + + "\x14BalanceCreditedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1f\n" + + "\vcustomer_id\x18\x02 \x01(\tR\n" + + "customerId\x12\x16\n" + + "\x06amount\x18\x03 \x01(\x02R\x06amount\x12\x1f\n" + + "\vnew_balance\x18\x04 \x01(\x02R\n" + + "newBalance\"\x8b\x01\n" + + "\x13BalanceDebitedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1f\n" + + "\vcustomer_id\x18\x02 \x01(\tR\n" + + "customerId\x12\x16\n" + + "\x06amount\x18\x03 \x01(\x02R\x06amount\x12\x1f\n" + + "\vnew_balance\x18\x04 \x01(\x02R\n" + + "newBalance\"k\n" + + "\x12BalanceClosedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1f\n" + + "\vcustomer_id\x18\x02 \x01(\tR\n" + + "customerId\x12\x18\n" + + "\abalance\x18\x03 \x01(\x02R\abalance\"\xaf\x01\n" + + "\x16TransactionLoggedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12%\n" + + "\x0etransaction_id\x18\x02 \x01(\tR\rtransactionId\x12\x16\n" + + "\x06amount\x18\x03 \x01(\x02R\x06amount\x12\x19\n" + + "\border_id\x18\x04 \x01(\tR\aorderId\x12\x1f\n" + + "\vcustomer_id\x18\x05 \x01(\tR\n" + + "customerId\"\xb1\x01\n" + + "\x18TransactionReversedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12%\n" + + "\x0etransaction_id\x18\x02 \x01(\tR\rtransactionId\x12\x16\n" + + "\x06amount\x18\x03 \x01(\x02R\x06amount\x12\x19\n" + + "\border_id\x18\x04 \x01(\tR\aorderId\x12\x1f\n" + + "\vcustomer_id\x18\x05 \x01(\tR\n" + + "customerId\"\xcb\x02\n" + + "\x15PaymentProcessedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12B\n" + + "\x04type\x18\x02 \x01(\x0e2..stocklet.events.v1.PaymentProcessedEvent.TypeR\x04type\x12\x19\n" + + "\border_id\x18\x03 \x01(\tR\aorderId\x12\x1f\n" + + "\vcustomer_id\x18\x04 \x01(\tR\n" + + "customerId\x12\x16\n" + + "\x06amount\x18\x05 \x01(\x02R\x06amount\x12*\n" + + "\x0etransaction_id\x18\x06 \x01(\tH\x00R\rtransactionId\x88\x01\x01\"?\n" + + "\x04Type\x12\x14\n" + + "\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n" + + "\vTYPE_FAILED\x10\x01\x12\x10\n" + + "\fTYPE_SUCCESS\x10\x02B\x11\n" + + "\x0f_transaction_idBGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3" var ( file_stocklet_events_v1_payment_proto_rawDescOnce sync.Once - file_stocklet_events_v1_payment_proto_rawDescData = file_stocklet_events_v1_payment_proto_rawDesc + file_stocklet_events_v1_payment_proto_rawDescData []byte ) func file_stocklet_events_v1_payment_proto_rawDescGZIP() []byte { file_stocklet_events_v1_payment_proto_rawDescOnce.Do(func() { - file_stocklet_events_v1_payment_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_payment_proto_rawDescData) + file_stocklet_events_v1_payment_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_payment_proto_rawDesc), len(file_stocklet_events_v1_payment_proto_rawDesc))) }) return file_stocklet_events_v1_payment_proto_rawDescData } var file_stocklet_events_v1_payment_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_stocklet_events_v1_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_stocklet_events_v1_payment_proto_goTypes = []interface{}{ +var file_stocklet_events_v1_payment_proto_goTypes = []any{ (PaymentProcessedEvent_Type)(0), // 0: stocklet.events.v1.PaymentProcessedEvent.Type (*BalanceCreatedEvent)(nil), // 1: stocklet.events.v1.BalanceCreatedEvent (*BalanceCreditedEvent)(nil), // 2: stocklet.events.v1.BalanceCreditedEvent @@ -724,98 +672,12 @@ func file_stocklet_events_v1_payment_proto_init() { if File_stocklet_events_v1_payment_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_events_v1_payment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceCreatedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_payment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceCreditedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_payment_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceDebitedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_payment_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceClosedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_payment_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionLoggedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_payment_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionReversedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_payment_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentProcessedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_events_v1_payment_proto_msgTypes[6].OneofWrappers = []interface{}{} + file_stocklet_events_v1_payment_proto_msgTypes[6].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_events_v1_payment_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_payment_proto_rawDesc), len(file_stocklet_events_v1_payment_proto_rawDesc)), NumEnums: 1, NumMessages: 7, NumExtensions: 0, @@ -827,7 +689,6 @@ func file_stocklet_events_v1_payment_proto_init() { MessageInfos: file_stocklet_events_v1_payment_proto_msgTypes, }.Build() File_stocklet_events_v1_payment_proto = out.File - file_stocklet_events_v1_payment_proto_rawDesc = nil file_stocklet_events_v1_payment_proto_goTypes = nil file_stocklet_events_v1_payment_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/events/v1/product.pb.go b/internal/pkg/protogen/events/v1/product.pb.go index 02558e9..f0c8e06 100644 --- a/internal/pkg/protogen/events/v1/product.pb.go +++ b/internal/pkg/protogen/events/v1/product.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/events/v1/product.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -85,24 +86,21 @@ func (ProductPriceQuoteEvent_Type) EnumDescriptor() ([]byte, []int) { } type ProductCreatedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Price float32 `protobuf:"fixed32,5,opt,name=price,proto3" json:"price,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - Price float32 `protobuf:"fixed32,5,opt,name=price,proto3" json:"price,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ProductCreatedEvent) Reset() { *x = ProductCreatedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_product_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_product_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProductCreatedEvent) String() string { @@ -113,7 +111,7 @@ func (*ProductCreatedEvent) ProtoMessage() {} func (x *ProductCreatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_product_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -164,22 +162,19 @@ func (x *ProductCreatedEvent) GetPrice() float32 { } type ProductPriceUpdatedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ProductPriceUpdatedEvent) Reset() { *x = ProductPriceUpdatedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_product_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_product_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProductPriceUpdatedEvent) String() string { @@ -190,7 +185,7 @@ func (*ProductPriceUpdatedEvent) ProtoMessage() {} func (x *ProductPriceUpdatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_product_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -227,21 +222,18 @@ func (x *ProductPriceUpdatedEvent) GetPrice() float32 { } type ProductDeletedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ProductDeletedEvent) Reset() { *x = ProductDeletedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_product_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_product_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProductDeletedEvent) String() string { @@ -252,7 +244,7 @@ func (*ProductDeletedEvent) ProtoMessage() {} func (x *ProductDeletedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_product_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -282,27 +274,24 @@ func (x *ProductDeletedEvent) GetProductId() string { } type ProductPriceQuoteEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` Type ProductPriceQuoteEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.ProductPriceQuoteEvent_Type" json:"type,omitempty"` OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` // Product ID: Quantity - ProductQuantities map[string]int32 `protobuf:"bytes,4,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + ProductQuantities map[string]int32 `protobuf:"bytes,4,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` // Product ID: Unit Price - ProductPrices map[string]float32 `protobuf:"bytes,5,rep,name=product_prices,json=productPrices,proto3" json:"product_prices,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + ProductPrices map[string]float32 `protobuf:"bytes,5,rep,name=product_prices,json=productPrices,proto3" json:"product_prices,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"fixed32,2,opt,name=value"` TotalPrice float32 `protobuf:"fixed32,6,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ProductPriceQuoteEvent) Reset() { *x = ProductPriceQuoteEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_product_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_product_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProductPriceQuoteEvent) String() string { @@ -313,7 +302,7 @@ func (*ProductPriceQuoteEvent) ProtoMessage() {} func (x *ProductPriceQuoteEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_product_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -372,93 +361,59 @@ func (x *ProductPriceQuoteEvent) GetTotalPrice() float32 { var File_stocklet_events_v1_product_proto protoreflect.FileDescriptor -var file_stocklet_events_v1_product_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x6b, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x22, 0x50, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x49, 0x64, 0x22, 0xdd, 0x04, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x73, 0x74, 0x6f, 0x63, - 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x70, 0x0a, 0x12, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x64, 0x0a, - 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x1a, 0x44, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, - 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x46, 0x0a, 0x04, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, - 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, - 0x4c, 0x45, 0x10, 0x02, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_events_v1_product_proto_rawDesc = "" + + "\n" + + " stocklet/events/v1/product.proto\x12\x12stocklet.events.v1\"\x9c\x01\n" + + "\x13ProductCreatedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x14\n" + + "\x05price\x18\x05 \x01(\x02R\x05price\"k\n" + + "\x18ProductPriceUpdatedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\x12\x14\n" + + "\x05price\x18\x03 \x01(\x02R\x05price\"P\n" + + "\x13ProductDeletedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\"\xdd\x04\n" + + "\x16ProductPriceQuoteEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12C\n" + + "\x04type\x18\x02 \x01(\x0e2/.stocklet.events.v1.ProductPriceQuoteEvent.TypeR\x04type\x12\x19\n" + + "\border_id\x18\x03 \x01(\tR\aorderId\x12p\n" + + "\x12product_quantities\x18\x04 \x03(\v2A.stocklet.events.v1.ProductPriceQuoteEvent.ProductQuantitiesEntryR\x11productQuantities\x12d\n" + + "\x0eproduct_prices\x18\x05 \x03(\v2=.stocklet.events.v1.ProductPriceQuoteEvent.ProductPricesEntryR\rproductPrices\x12\x1f\n" + + "\vtotal_price\x18\x06 \x01(\x02R\n" + + "totalPrice\x1aD\n" + + "\x16ProductQuantitiesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\x1a@\n" + + "\x12ProductPricesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x02R\x05value:\x028\x01\"F\n" + + "\x04Type\x12\x14\n" + + "\x10TYPE_UNSPECIFIED\x10\x00\x12\x14\n" + + "\x10TYPE_UNAVAILABLE\x10\x01\x12\x12\n" + + "\x0eTYPE_AVAILABLE\x10\x02BGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3" var ( file_stocklet_events_v1_product_proto_rawDescOnce sync.Once - file_stocklet_events_v1_product_proto_rawDescData = file_stocklet_events_v1_product_proto_rawDesc + file_stocklet_events_v1_product_proto_rawDescData []byte ) func file_stocklet_events_v1_product_proto_rawDescGZIP() []byte { file_stocklet_events_v1_product_proto_rawDescOnce.Do(func() { - file_stocklet_events_v1_product_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_product_proto_rawDescData) + file_stocklet_events_v1_product_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_product_proto_rawDesc), len(file_stocklet_events_v1_product_proto_rawDesc))) }) return file_stocklet_events_v1_product_proto_rawDescData } var file_stocklet_events_v1_product_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_stocklet_events_v1_product_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_stocklet_events_v1_product_proto_goTypes = []interface{}{ +var file_stocklet_events_v1_product_proto_goTypes = []any{ (ProductPriceQuoteEvent_Type)(0), // 0: stocklet.events.v1.ProductPriceQuoteEvent.Type (*ProductCreatedEvent)(nil), // 1: stocklet.events.v1.ProductCreatedEvent (*ProductPriceUpdatedEvent)(nil), // 2: stocklet.events.v1.ProductPriceUpdatedEvent @@ -483,61 +438,11 @@ func file_stocklet_events_v1_product_proto_init() { if File_stocklet_events_v1_product_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_events_v1_product_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductCreatedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_product_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductPriceUpdatedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_product_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductDeletedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_product_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductPriceQuoteEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_events_v1_product_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_product_proto_rawDesc), len(file_stocklet_events_v1_product_proto_rawDesc)), NumEnums: 1, NumMessages: 6, NumExtensions: 0, @@ -549,7 +454,6 @@ func file_stocklet_events_v1_product_proto_init() { MessageInfos: file_stocklet_events_v1_product_proto_msgTypes, }.Build() File_stocklet_events_v1_product_proto = out.File - file_stocklet_events_v1_product_proto_rawDesc = nil file_stocklet_events_v1_product_proto_goTypes = nil file_stocklet_events_v1_product_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/events/v1/shipping.pb.go b/internal/pkg/protogen/events/v1/shipping.pb.go index 0921606..b5190f3 100644 --- a/internal/pkg/protogen/events/v1/shipping.pb.go +++ b/internal/pkg/protogen/events/v1/shipping.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/events/v1/shipping.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -88,25 +89,22 @@ func (ShipmentAllocationEvent_Type) EnumDescriptor() ([]byte, []int) { } type ShipmentAllocationEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` Type ShipmentAllocationEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.ShipmentAllocationEvent_Type" json:"type,omitempty"` OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` OrderMetadata *ShipmentAllocationEvent_OrderMetadata `protobuf:"bytes,4,opt,name=order_metadata,json=orderMetadata,proto3" json:"order_metadata,omitempty"` ShipmentId string `protobuf:"bytes,5,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` // provided with type enum value 2+ - ProductQuantities map[string]int32 `protobuf:"bytes,6,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + ProductQuantities map[string]int32 `protobuf:"bytes,6,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ShipmentAllocationEvent) Reset() { *x = ShipmentAllocationEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_shipping_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_shipping_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ShipmentAllocationEvent) String() string { @@ -117,7 +115,7 @@ func (*ShipmentAllocationEvent) ProtoMessage() {} func (x *ShipmentAllocationEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_shipping_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -175,23 +173,20 @@ func (x *ShipmentAllocationEvent) GetProductQuantities() map[string]int32 { } type ShipmentDispatchedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - ShipmentId string `protobuf:"bytes,2,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` - OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - ProductQuantities map[string]int32 `protobuf:"bytes,4,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + ShipmentId string `protobuf:"bytes,2,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` + OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + ProductQuantities map[string]int32 `protobuf:"bytes,4,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ShipmentDispatchedEvent) Reset() { *x = ShipmentDispatchedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_shipping_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_shipping_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ShipmentDispatchedEvent) String() string { @@ -202,7 +197,7 @@ func (*ShipmentDispatchedEvent) ProtoMessage() {} func (x *ShipmentDispatchedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_shipping_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -246,22 +241,19 @@ func (x *ShipmentDispatchedEvent) GetProductQuantities() map[string]int32 { } type ShipmentAllocationEvent_OrderMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + ItemsPrice float32 `protobuf:"fixed32,2,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"` + TotalPrice float32 `protobuf:"fixed32,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` unknownFields protoimpl.UnknownFields - - CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - ItemsPrice float32 `protobuf:"fixed32,2,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"` - TotalPrice float32 `protobuf:"fixed32,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ShipmentAllocationEvent_OrderMetadata) Reset() { *x = ShipmentAllocationEvent_OrderMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_shipping_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_shipping_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ShipmentAllocationEvent_OrderMetadata) String() string { @@ -272,7 +264,7 @@ func (*ShipmentAllocationEvent_OrderMetadata) ProtoMessage() {} func (x *ShipmentAllocationEvent_OrderMetadata) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_shipping_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -310,94 +302,57 @@ func (x *ShipmentAllocationEvent_OrderMetadata) GetTotalPrice() float32 { var File_stocklet_events_v1_shipping_proto protoreflect.FileDescriptor -var file_stocklet_events_v1_shipping_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0xa7, 0x05, 0x0a, 0x17, 0x53, 0x68, 0x69, 0x70, - 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x44, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x60, 0x0a, 0x0e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, - 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, - 0x74, 0x49, 0x64, 0x12, 0x71, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x71, - 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x42, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x72, 0x0a, 0x0d, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x74, 0x65, 0x6d, - 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x1a, 0x44, 0x0a, 0x16, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x5f, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, - 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, - 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, - 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10, - 0x03, 0x22, 0xaa, 0x02, 0x0a, 0x17, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x69, - 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x69, - 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x71, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x42, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x44, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x47, - 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, - 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_events_v1_shipping_proto_rawDesc = "" + + "\n" + + "!stocklet/events/v1/shipping.proto\x12\x12stocklet.events.v1\"\xa7\x05\n" + + "\x17ShipmentAllocationEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12D\n" + + "\x04type\x18\x02 \x01(\x0e20.stocklet.events.v1.ShipmentAllocationEvent.TypeR\x04type\x12\x19\n" + + "\border_id\x18\x03 \x01(\tR\aorderId\x12`\n" + + "\x0eorder_metadata\x18\x04 \x01(\v29.stocklet.events.v1.ShipmentAllocationEvent.OrderMetadataR\rorderMetadata\x12\x1f\n" + + "\vshipment_id\x18\x05 \x01(\tR\n" + + "shipmentId\x12q\n" + + "\x12product_quantities\x18\x06 \x03(\v2B.stocklet.events.v1.ShipmentAllocationEvent.ProductQuantitiesEntryR\x11productQuantities\x1ar\n" + + "\rOrderMetadata\x12\x1f\n" + + "\vcustomer_id\x18\x01 \x01(\tR\n" + + "customerId\x12\x1f\n" + + "\vitems_price\x18\x02 \x01(\x02R\n" + + "itemsPrice\x12\x1f\n" + + "\vtotal_price\x18\x03 \x01(\x02R\n" + + "totalPrice\x1aD\n" + + "\x16ProductQuantitiesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"_\n" + + "\x04Type\x12\x14\n" + + "\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n" + + "\vTYPE_FAILED\x10\x01\x12\x12\n" + + "\x0eTYPE_ALLOCATED\x10\x02\x12\x1c\n" + + "\x18TYPE_ALLOCATION_RELEASED\x10\x03\"\xaa\x02\n" + + "\x17ShipmentDispatchedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1f\n" + + "\vshipment_id\x18\x02 \x01(\tR\n" + + "shipmentId\x12\x19\n" + + "\border_id\x18\x03 \x01(\tR\aorderId\x12q\n" + + "\x12product_quantities\x18\x04 \x03(\v2B.stocklet.events.v1.ShipmentDispatchedEvent.ProductQuantitiesEntryR\x11productQuantities\x1aD\n" + + "\x16ProductQuantitiesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01BGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3" var ( file_stocklet_events_v1_shipping_proto_rawDescOnce sync.Once - file_stocklet_events_v1_shipping_proto_rawDescData = file_stocklet_events_v1_shipping_proto_rawDesc + file_stocklet_events_v1_shipping_proto_rawDescData []byte ) func file_stocklet_events_v1_shipping_proto_rawDescGZIP() []byte { file_stocklet_events_v1_shipping_proto_rawDescOnce.Do(func() { - file_stocklet_events_v1_shipping_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_shipping_proto_rawDescData) + file_stocklet_events_v1_shipping_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_shipping_proto_rawDesc), len(file_stocklet_events_v1_shipping_proto_rawDesc))) }) return file_stocklet_events_v1_shipping_proto_rawDescData } var file_stocklet_events_v1_shipping_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_stocklet_events_v1_shipping_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_stocklet_events_v1_shipping_proto_goTypes = []interface{}{ +var file_stocklet_events_v1_shipping_proto_goTypes = []any{ (ShipmentAllocationEvent_Type)(0), // 0: stocklet.events.v1.ShipmentAllocationEvent.Type (*ShipmentAllocationEvent)(nil), // 1: stocklet.events.v1.ShipmentAllocationEvent (*ShipmentDispatchedEvent)(nil), // 2: stocklet.events.v1.ShipmentDispatchedEvent @@ -422,49 +377,11 @@ func file_stocklet_events_v1_shipping_proto_init() { if File_stocklet_events_v1_shipping_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_events_v1_shipping_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShipmentAllocationEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_shipping_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShipmentDispatchedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_shipping_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShipmentAllocationEvent_OrderMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_events_v1_shipping_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_shipping_proto_rawDesc), len(file_stocklet_events_v1_shipping_proto_rawDesc)), NumEnums: 1, NumMessages: 5, NumExtensions: 0, @@ -476,7 +393,6 @@ func file_stocklet_events_v1_shipping_proto_init() { MessageInfos: file_stocklet_events_v1_shipping_proto_msgTypes, }.Build() File_stocklet_events_v1_shipping_proto = out.File - file_stocklet_events_v1_shipping_proto_rawDesc = nil file_stocklet_events_v1_shipping_proto_goTypes = nil file_stocklet_events_v1_shipping_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/events/v1/user.pb.go b/internal/pkg/protogen/events/v1/user.pb.go index f201304..4dae67c 100644 --- a/internal/pkg/protogen/events/v1/user.pb.go +++ b/internal/pkg/protogen/events/v1/user.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/events/v1/user.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -36,24 +37,21 @@ const ( ) type UserCreatedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + FirstName string `protobuf:"bytes,4,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` + LastName string `protobuf:"bytes,5,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - FirstName string `protobuf:"bytes,4,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` - LastName string `protobuf:"bytes,5,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UserCreatedEvent) Reset() { *x = UserCreatedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_user_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UserCreatedEvent) String() string { @@ -64,7 +62,7 @@ func (*UserCreatedEvent) ProtoMessage() {} func (x *UserCreatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_user_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -115,22 +113,19 @@ func (x *UserCreatedEvent) GetLastName() string { } type UserEmailUpdatedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UserEmailUpdatedEvent) Reset() { *x = UserEmailUpdatedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_user_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UserEmailUpdatedEvent) String() string { @@ -141,7 +136,7 @@ func (*UserEmailUpdatedEvent) ProtoMessage() {} func (x *UserEmailUpdatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_user_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -178,22 +173,19 @@ func (x *UserEmailUpdatedEvent) GetEmail() string { } type UserDeletedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UserDeletedEvent) Reset() { *x = UserDeletedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_user_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UserDeletedEvent) String() string { @@ -204,7 +196,7 @@ func (*UserDeletedEvent) ProtoMessage() {} func (x *UserDeletedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_user_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -242,54 +234,39 @@ func (x *UserDeletedEvent) GetEmail() string { var File_stocklet_events_v1_user_proto protoreflect.FileDescriptor -var file_stocklet_events_v1_user_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x22, 0x99, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, - 0x62, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x22, 0x5d, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, - 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_stocklet_events_v1_user_proto_rawDesc = "" + + "\n" + + "\x1dstocklet/events/v1/user.proto\x12\x12stocklet.events.v1\"\x99\x01\n" + + "\x10UserCreatedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x17\n" + + "\auser_id\x18\x02 \x01(\tR\x06userId\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\x12\x1d\n" + + "\n" + + "first_name\x18\x04 \x01(\tR\tfirstName\x12\x1b\n" + + "\tlast_name\x18\x05 \x01(\tR\blastName\"b\n" + + "\x15UserEmailUpdatedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x17\n" + + "\auser_id\x18\x02 \x01(\tR\x06userId\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\"]\n" + + "\x10UserDeletedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x17\n" + + "\auser_id\x18\x02 \x01(\tR\x06userId\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05emailBGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3" var ( file_stocklet_events_v1_user_proto_rawDescOnce sync.Once - file_stocklet_events_v1_user_proto_rawDescData = file_stocklet_events_v1_user_proto_rawDesc + file_stocklet_events_v1_user_proto_rawDescData []byte ) func file_stocklet_events_v1_user_proto_rawDescGZIP() []byte { file_stocklet_events_v1_user_proto_rawDescOnce.Do(func() { - file_stocklet_events_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_user_proto_rawDescData) + file_stocklet_events_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_user_proto_rawDesc), len(file_stocklet_events_v1_user_proto_rawDesc))) }) return file_stocklet_events_v1_user_proto_rawDescData } var file_stocklet_events_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_stocklet_events_v1_user_proto_goTypes = []interface{}{ +var file_stocklet_events_v1_user_proto_goTypes = []any{ (*UserCreatedEvent)(nil), // 0: stocklet.events.v1.UserCreatedEvent (*UserEmailUpdatedEvent)(nil), // 1: stocklet.events.v1.UserEmailUpdatedEvent (*UserDeletedEvent)(nil), // 2: stocklet.events.v1.UserDeletedEvent @@ -307,49 +284,11 @@ func file_stocklet_events_v1_user_proto_init() { if File_stocklet_events_v1_user_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_events_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCreatedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserEmailUpdatedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserDeletedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_events_v1_user_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_user_proto_rawDesc), len(file_stocklet_events_v1_user_proto_rawDesc)), NumEnums: 0, NumMessages: 3, NumExtensions: 0, @@ -360,7 +299,6 @@ func file_stocklet_events_v1_user_proto_init() { MessageInfos: file_stocklet_events_v1_user_proto_msgTypes, }.Build() File_stocklet_events_v1_user_proto = out.File - file_stocklet_events_v1_user_proto_rawDesc = nil file_stocklet_events_v1_user_proto_goTypes = nil file_stocklet_events_v1_user_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/events/v1/warehouse.pb.go b/internal/pkg/protogen/events/v1/warehouse.pb.go index fc2c898..c66f204 100644 --- a/internal/pkg/protogen/events/v1/warehouse.pb.go +++ b/internal/pkg/protogen/events/v1/warehouse.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/events/v1/warehouse.proto @@ -26,6 +26,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -91,22 +92,19 @@ func (StockReservationEvent_Type) EnumDescriptor() ([]byte, []int) { } type StockCreatedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StockCreatedEvent) Reset() { *x = StockCreatedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockCreatedEvent) String() string { @@ -117,7 +115,7 @@ func (*StockCreatedEvent) ProtoMessage() {} func (x *StockCreatedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -154,25 +152,22 @@ func (x *StockCreatedEvent) GetQuantity() int32 { } type StockAddedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` // If the stock is returned as a result of a stock reservation outcome, // then the reservation id will be included for reference. ReservationId *string `protobuf:"bytes,4,opt,name=reservation_id,json=reservationId,proto3,oneof" json:"reservation_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockAddedEvent) Reset() { *x = StockAddedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockAddedEvent) String() string { @@ -183,7 +178,7 @@ func (*StockAddedEvent) ProtoMessage() {} func (x *StockAddedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -227,25 +222,22 @@ func (x *StockAddedEvent) GetReservationId() string { } type StockRemovedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` // If the stock is removed as a result of a stock reservation being closed, // then the reservation id will be included for reference. ReservationId *string `protobuf:"bytes,4,opt,name=reservation_id,json=reservationId,proto3,oneof" json:"reservation_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockRemovedEvent) Reset() { *x = StockRemovedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockRemovedEvent) String() string { @@ -256,7 +248,7 @@ func (*StockRemovedEvent) ProtoMessage() {} func (x *StockRemovedEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -300,26 +292,23 @@ func (x *StockRemovedEvent) GetReservationId() string { } type StockReservationEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` Type StockReservationEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.StockReservationEvent_Type" json:"type,omitempty"` OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` OrderMetadata *StockReservationEvent_OrderMetadata `protobuf:"bytes,4,opt,name=order_metadata,json=orderMetadata,proto3" json:"order_metadata,omitempty"` - ReservationId string `protobuf:"bytes,5,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` // provided with type enum value 2+ - ReservationStock map[string]int32 `protobuf:"bytes,6,rep,name=reservation_stock,json=reservationStock,proto3" json:"reservation_stock,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // Product ID: Quantity (provided with type enum value 2+) - InsufficientStock []string `protobuf:"bytes,7,rep,name=insufficient_stock,json=insufficientStock,proto3" json:"insufficient_stock,omitempty"` // Product IDs (only provided with TYPE_INSUFFICIENT_STOCK) + ReservationId string `protobuf:"bytes,5,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` // provided with type enum value 2+ + ReservationStock map[string]int32 `protobuf:"bytes,6,rep,name=reservation_stock,json=reservationStock,proto3" json:"reservation_stock,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` // Product ID: Quantity (provided with type enum value 2+) + InsufficientStock []string `protobuf:"bytes,7,rep,name=insufficient_stock,json=insufficientStock,proto3" json:"insufficient_stock,omitempty"` // Product IDs (only provided with TYPE_INSUFFICIENT_STOCK) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StockReservationEvent) Reset() { *x = StockReservationEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockReservationEvent) String() string { @@ -330,7 +319,7 @@ func (*StockReservationEvent) ProtoMessage() {} func (x *StockReservationEvent) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -395,22 +384,19 @@ func (x *StockReservationEvent) GetInsufficientStock() []string { } type StockReservationEvent_OrderMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + ItemsPrice float32 `protobuf:"fixed32,2,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"` + TotalPrice float32 `protobuf:"fixed32,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` unknownFields protoimpl.UnknownFields - - CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - ItemsPrice float32 `protobuf:"fixed32,2,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"` - TotalPrice float32 `protobuf:"fixed32,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` + sizeCache protoimpl.SizeCache } func (x *StockReservationEvent_OrderMetadata) Reset() { *x = StockReservationEvent_OrderMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StockReservationEvent_OrderMetadata) String() string { @@ -421,7 +407,7 @@ func (*StockReservationEvent_OrderMetadata) ProtoMessage() {} func (x *StockReservationEvent_OrderMetadata) ProtoReflect() protoreflect.Message { mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -459,108 +445,68 @@ func (x *StockReservationEvent_OrderMetadata) GetTotalPrice() float32 { var File_stocklet_events_v1_warehouse_proto protoreflect.FileDescriptor -var file_stocklet_events_v1_warehouse_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x6a, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x63, - 0x6b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x22, 0xa3, 0x01, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64, - 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0xa5, 0x01, 0x0a, 0x11, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, - 0x11, 0x0a, 0x0f, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x22, 0xf6, 0x05, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x5e, 0x0a, 0x0e, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x37, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x6c, - 0x0a, 0x11, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x73, 0x74, 0x6f, 0x63, - 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x2d, 0x0a, 0x12, - 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, - 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x1a, 0x72, 0x0a, 0x0d, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, - 0x0b, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x02, 0x52, 0x0a, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x02, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x1a, - 0x43, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x84, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, - 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55, - 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b, 0x10, 0x01, - 0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b, 0x5f, 0x52, - 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x44, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b, 0x5f, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4e, 0x45, 0x44, - 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b, - 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x55, 0x4d, 0x45, 0x44, 0x10, 0x04, 0x42, 0x47, 0x5a, 0x45, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, - 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, - 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_events_v1_warehouse_proto_rawDesc = "" + + "\n" + + "\"stocklet/events/v1/warehouse.proto\x12\x12stocklet.events.v1\"j\n" + + "\x11StockCreatedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\x12\x1a\n" + + "\bquantity\x18\x03 \x01(\x05R\bquantity\"\xa3\x01\n" + + "\x0fStockAddedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\x12\x16\n" + + "\x06amount\x18\x03 \x01(\x05R\x06amount\x12*\n" + + "\x0ereservation_id\x18\x04 \x01(\tH\x00R\rreservationId\x88\x01\x01B\x11\n" + + "\x0f_reservation_id\"\xa5\x01\n" + + "\x11StockRemovedEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\tR\tproductId\x12\x16\n" + + "\x06amount\x18\x03 \x01(\x05R\x06amount\x12*\n" + + "\x0ereservation_id\x18\x04 \x01(\tH\x00R\rreservationId\x88\x01\x01B\x11\n" + + "\x0f_reservation_id\"\xf6\x05\n" + + "\x15StockReservationEvent\x12\x1a\n" + + "\brevision\x18\x01 \x01(\x05R\brevision\x12B\n" + + "\x04type\x18\x02 \x01(\x0e2..stocklet.events.v1.StockReservationEvent.TypeR\x04type\x12\x19\n" + + "\border_id\x18\x03 \x01(\tR\aorderId\x12^\n" + + "\x0eorder_metadata\x18\x04 \x01(\v27.stocklet.events.v1.StockReservationEvent.OrderMetadataR\rorderMetadata\x12%\n" + + "\x0ereservation_id\x18\x05 \x01(\tR\rreservationId\x12l\n" + + "\x11reservation_stock\x18\x06 \x03(\v2?.stocklet.events.v1.StockReservationEvent.ReservationStockEntryR\x10reservationStock\x12-\n" + + "\x12insufficient_stock\x18\a \x03(\tR\x11insufficientStock\x1ar\n" + + "\rOrderMetadata\x12\x1f\n" + + "\vcustomer_id\x18\x01 \x01(\tR\n" + + "customerId\x12\x1f\n" + + "\vitems_price\x18\x02 \x01(\x02R\n" + + "itemsPrice\x12\x1f\n" + + "\vtotal_price\x18\x03 \x01(\x02R\n" + + "totalPrice\x1aC\n" + + "\x15ReservationStockEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"\x84\x01\n" + + "\x04Type\x12\x14\n" + + "\x10TYPE_UNSPECIFIED\x10\x00\x12\x1b\n" + + "\x17TYPE_INSUFFICIENT_STOCK\x10\x01\x12\x17\n" + + "\x13TYPE_STOCK_RESERVED\x10\x02\x12\x17\n" + + "\x13TYPE_STOCK_RETURNED\x10\x03\x12\x17\n" + + "\x13TYPE_STOCK_CONSUMED\x10\x04BGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3" var ( file_stocklet_events_v1_warehouse_proto_rawDescOnce sync.Once - file_stocklet_events_v1_warehouse_proto_rawDescData = file_stocklet_events_v1_warehouse_proto_rawDesc + file_stocklet_events_v1_warehouse_proto_rawDescData []byte ) func file_stocklet_events_v1_warehouse_proto_rawDescGZIP() []byte { file_stocklet_events_v1_warehouse_proto_rawDescOnce.Do(func() { - file_stocklet_events_v1_warehouse_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_warehouse_proto_rawDescData) + file_stocklet_events_v1_warehouse_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_warehouse_proto_rawDesc), len(file_stocklet_events_v1_warehouse_proto_rawDesc))) }) return file_stocklet_events_v1_warehouse_proto_rawDescData } var file_stocklet_events_v1_warehouse_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_stocklet_events_v1_warehouse_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_stocklet_events_v1_warehouse_proto_goTypes = []interface{}{ +var file_stocklet_events_v1_warehouse_proto_goTypes = []any{ (StockReservationEvent_Type)(0), // 0: stocklet.events.v1.StockReservationEvent.Type (*StockCreatedEvent)(nil), // 1: stocklet.events.v1.StockCreatedEvent (*StockAddedEvent)(nil), // 2: stocklet.events.v1.StockAddedEvent @@ -585,75 +531,13 @@ func file_stocklet_events_v1_warehouse_proto_init() { if File_stocklet_events_v1_warehouse_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_events_v1_warehouse_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockCreatedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_warehouse_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockAddedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_warehouse_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockRemovedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_warehouse_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockReservationEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_events_v1_warehouse_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StockReservationEvent_OrderMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_events_v1_warehouse_proto_msgTypes[1].OneofWrappers = []interface{}{} - file_stocklet_events_v1_warehouse_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_stocklet_events_v1_warehouse_proto_msgTypes[1].OneofWrappers = []any{} + file_stocklet_events_v1_warehouse_proto_msgTypes[2].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_events_v1_warehouse_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_warehouse_proto_rawDesc), len(file_stocklet_events_v1_warehouse_proto_rawDesc)), NumEnums: 1, NumMessages: 6, NumExtensions: 0, @@ -665,7 +549,6 @@ func file_stocklet_events_v1_warehouse_proto_init() { MessageInfos: file_stocklet_events_v1_warehouse_proto_msgTypes, }.Build() File_stocklet_events_v1_warehouse_proto = out.File - file_stocklet_events_v1_warehouse_proto_rawDesc = nil file_stocklet_events_v1_warehouse_proto_goTypes = nil file_stocklet_events_v1_warehouse_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/order/v1/service.pb.go b/internal/pkg/protogen/order/v1/service.pb.go index ed98153..fd2d6aa 100644 --- a/internal/pkg/protogen/order/v1/service.pb.go +++ b/internal/pkg/protogen/order/v1/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/order/v1/service.proto @@ -32,6 +32,7 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -42,20 +43,17 @@ const ( ) type ViewOrderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` unknownFields protoimpl.UnknownFields - - OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewOrderRequest) Reset() { *x = ViewOrderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewOrderRequest) String() string { @@ -66,7 +64,7 @@ func (*ViewOrderRequest) ProtoMessage() {} func (x *ViewOrderRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -89,20 +87,17 @@ func (x *ViewOrderRequest) GetOrderId() string { } type ViewOrderResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` unknownFields protoimpl.UnknownFields - - Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewOrderResponse) Reset() { *x = ViewOrderResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewOrderResponse) String() string { @@ -113,7 +108,7 @@ func (*ViewOrderResponse) ProtoMessage() {} func (x *ViewOrderResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -136,20 +131,17 @@ func (x *ViewOrderResponse) GetOrder() *Order { } type ViewOrdersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` unknownFields protoimpl.UnknownFields - - CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewOrdersRequest) Reset() { *x = ViewOrdersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewOrdersRequest) String() string { @@ -160,7 +152,7 @@ func (*ViewOrdersRequest) ProtoMessage() {} func (x *ViewOrdersRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,20 +175,17 @@ func (x *ViewOrdersRequest) GetCustomerId() string { } type ViewOrdersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"` unknownFields protoimpl.UnknownFields - - Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewOrdersResponse) Reset() { *x = ViewOrdersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewOrdersResponse) String() string { @@ -207,7 +196,7 @@ func (*ViewOrdersResponse) ProtoMessage() {} func (x *ViewOrdersResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -230,20 +219,17 @@ func (x *ViewOrdersResponse) GetOrders() []*Order { } type GetOrderItemsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetOrderItemsRequest) Reset() { *x = GetOrderItemsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetOrderItemsRequest) String() string { @@ -254,7 +240,7 @@ func (*GetOrderItemsRequest) ProtoMessage() {} func (x *GetOrderItemsRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -277,20 +263,17 @@ func (x *GetOrderItemsRequest) GetId() string { } type GetOrderItemsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Items map[string]int32 `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` unknownFields protoimpl.UnknownFields - - Items map[string]int32 `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + sizeCache protoimpl.SizeCache } func (x *GetOrderItemsResponse) Reset() { *x = GetOrderItemsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetOrderItemsResponse) String() string { @@ -301,7 +284,7 @@ func (*GetOrderItemsResponse) ProtoMessage() {} func (x *GetOrderItemsResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -324,21 +307,18 @@ func (x *GetOrderItemsResponse) GetItems() map[string]int32 { } type PlaceOrderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Cart map[string]int32 `protobuf:"bytes,1,rep,name=cart,proto3" json:"cart,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` unknownFields protoimpl.UnknownFields - - Cart map[string]int32 `protobuf:"bytes,1,rep,name=cart,proto3" json:"cart,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PlaceOrderRequest) Reset() { *x = PlaceOrderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PlaceOrderRequest) String() string { @@ -349,7 +329,7 @@ func (*PlaceOrderRequest) ProtoMessage() {} func (x *PlaceOrderRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -379,20 +359,17 @@ func (x *PlaceOrderRequest) GetCustomerId() string { } type PlaceOrderResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` unknownFields protoimpl.UnknownFields - - Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PlaceOrderResponse) Reset() { *x = PlaceOrderResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PlaceOrderResponse) String() string { @@ -403,7 +380,7 @@ func (*PlaceOrderResponse) ProtoMessage() {} func (x *PlaceOrderResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_service_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -427,159 +404,65 @@ func (x *PlaceOrderResponse) GetOrder() *Order { var File_stocklet_order_v1_service_proto protoreflect.FileDescriptor -var file_stocklet_order_v1_service_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x11, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x36, 0x0a, 0x10, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x08, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, - 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x43, - 0x0a, 0x11, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x22, 0x3d, 0x0a, 0x11, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, - 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, - 0x49, 0x64, 0x22, 0x46, 0x0a, 0x12, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x22, 0x2f, 0x0a, 0x14, 0x47, 0x65, - 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaa, 0x01, 0x0a, 0x15, - 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48, 0x09, 0x9a, 0x01, - 0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x38, - 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbf, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x61, - 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, - 0x0a, 0x04, 0x63, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48, - 0x09, 0x9a, 0x01, 0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x04, 0x63, 0x61, 0x72, 0x74, - 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, - 0x64, 0x1a, 0x37, 0x0a, 0x09, 0x43, 0x61, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x12, 0x50, 0x6c, - 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x32, 0xcd, 0x07, 0x0a, 0x0c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x79, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x09, - 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x73, 0x74, 0x6f, 0x63, - 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, - 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, - 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, - 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x0a, 0x56, 0x69, 0x65, - 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, - 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x78, 0x0a, 0x0a, - 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, - 0x04, 0x63, 0x61, 0x72, 0x74, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x2f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x1d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, - 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, - 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, - 0x1c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, - 0x41, 0x4c, 0x12, 0x77, 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x68, 0x69, - 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, - 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, - 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, 0x1c, 0x50, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, - 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, - 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, - 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, - 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_order_v1_service_proto_rawDesc = "" + + "\n" + + "\x1fstocklet/order/v1/service.proto\x12\x11stocklet.order.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a!stocklet/common/v1/requests.proto\x1a stocklet/events/v1/payment.proto\x1a stocklet/events/v1/product.proto\x1a!stocklet/events/v1/shipping.proto\x1a\"stocklet/events/v1/warehouse.proto\x1a\x1dstocklet/order/v1/types.proto\"6\n" + + "\x10ViewOrderRequest\x12\"\n" + + "\border_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\aorderId\"C\n" + + "\x11ViewOrderResponse\x12.\n" + + "\x05order\x18\x01 \x01(\v2\x18.stocklet.order.v1.OrderR\x05order\"=\n" + + "\x11ViewOrdersRequest\x12(\n" + + "\vcustomer_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "customerId\"F\n" + + "\x12ViewOrdersResponse\x120\n" + + "\x06orders\x18\x01 \x03(\v2\x18.stocklet.order.v1.OrderR\x06orders\"/\n" + + "\x14GetOrderItemsRequest\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\"\xaa\x01\n" + + "\x15GetOrderItemsResponse\x12W\n" + + "\x05items\x18\x01 \x03(\v23.stocklet.order.v1.GetOrderItemsResponse.ItemsEntryB\f\xbaH\t\x9a\x01\x06*\x04\x1a\x02 \x00R\x05items\x1a8\n" + + "\n" + + "ItemsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"\xbf\x01\n" + + "\x11PlaceOrderRequest\x12P\n" + + "\x04cart\x18\x01 \x03(\v2..stocklet.order.v1.PlaceOrderRequest.CartEntryB\f\xbaH\t\x9a\x01\x06*\x04\x1a\x02 \x00R\x04cart\x12\x1f\n" + + "\vcustomer_id\x18\x02 \x01(\tR\n" + + "customerId\x1a7\n" + + "\tCartEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"D\n" + + "\x12PlaceOrderResponse\x12.\n" + + "\x05order\x18\x01 \x01(\v2\x18.stocklet.order.v1.OrderR\x05order2\xcd\a\n" + + "\fOrderService\x12y\n" + + "\vServiceInfo\x12&.stocklet.common.v1.ServiceInfoRequest\x1a'.stocklet.common.v1.ServiceInfoResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/order/service\x12{\n" + + "\tViewOrder\x12#.stocklet.order.v1.ViewOrderRequest\x1a$.stocklet.order.v1.ViewOrderResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/order/orders/{order_id}\x12q\n" + + "\n" + + "ViewOrders\x12$.stocklet.order.v1.ViewOrdersRequest\x1a%.stocklet.order.v1.ViewOrdersResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/v1/order/list\x12x\n" + + "\n" + + "PlaceOrder\x12$.stocklet.order.v1.PlaceOrderRequest\x1a%.stocklet.order.v1.PlaceOrderResponse\"\x1d\x82\xd3\xe4\x93\x02\x17:\x04cart\"\x0f/v1/order/place\x12u\n" + + "\x1dProcessProductPriceQuoteEvent\x12*.stocklet.events.v1.ProductPriceQuoteEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12s\n" + + "\x1cProcessStockReservationEvent\x12).stocklet.events.v1.StockReservationEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12w\n" + + "\x1eProcessShipmentAllocationEvent\x12+.stocklet.events.v1.ShipmentAllocationEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12s\n" + + "\x1cProcessPaymentProcessedEvent\x12).stocklet.events.v1.PaymentProcessedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNALBEZCgithub.com/hexolan/stocklet/internal/pkg/protogen/order/v1;order_v1b\x06proto3" var ( file_stocklet_order_v1_service_proto_rawDescOnce sync.Once - file_stocklet_order_v1_service_proto_rawDescData = file_stocklet_order_v1_service_proto_rawDesc + file_stocklet_order_v1_service_proto_rawDescData []byte ) func file_stocklet_order_v1_service_proto_rawDescGZIP() []byte { file_stocklet_order_v1_service_proto_rawDescOnce.Do(func() { - file_stocklet_order_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_order_v1_service_proto_rawDescData) + file_stocklet_order_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_order_v1_service_proto_rawDesc), len(file_stocklet_order_v1_service_proto_rawDesc))) }) return file_stocklet_order_v1_service_proto_rawDescData } var file_stocklet_order_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_stocklet_order_v1_service_proto_goTypes = []interface{}{ +var file_stocklet_order_v1_service_proto_goTypes = []any{ (*ViewOrderRequest)(nil), // 0: stocklet.order.v1.ViewOrderRequest (*ViewOrderResponse)(nil), // 1: stocklet.order.v1.ViewOrderResponse (*ViewOrdersRequest)(nil), // 2: stocklet.order.v1.ViewOrdersRequest @@ -634,109 +517,11 @@ func file_stocklet_order_v1_service_proto_init() { return } file_stocklet_order_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_stocklet_order_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewOrderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_order_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewOrderResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_order_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewOrdersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_order_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewOrdersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_order_v1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrderItemsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_order_v1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrderItemsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_order_v1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlaceOrderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_order_v1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlaceOrderResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_order_v1_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_order_v1_service_proto_rawDesc), len(file_stocklet_order_v1_service_proto_rawDesc)), NumEnums: 0, NumMessages: 10, NumExtensions: 0, @@ -747,7 +532,6 @@ func file_stocklet_order_v1_service_proto_init() { MessageInfos: file_stocklet_order_v1_service_proto_msgTypes, }.Build() File_stocklet_order_v1_service_proto = out.File - file_stocklet_order_v1_service_proto_rawDesc = nil file_stocklet_order_v1_service_proto_goTypes = nil file_stocklet_order_v1_service_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/order/v1/service.pb.gw.go b/internal/pkg/protogen/order/v1/service.pb.gw.go index f971975..3c6f662 100644 --- a/internal/pkg/protogen/order/v1/service.pb.gw.go +++ b/internal/pkg/protogen/order/v1/service.pb.gw.go @@ -10,6 +10,7 @@ package order_v1 import ( "context" + "errors" "io" "net/http" @@ -25,186 +26,165 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_OrderService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OrderService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) msg, err := server.ServiceInfo(ctx, &protoReq) return msg, metadata, err - } func request_OrderService_ViewOrder_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewOrderRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewOrderRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["order_id"] + val, ok := pathParams["order_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "order_id") } - protoReq.OrderId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "order_id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OrderService_ViewOrder_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewOrderRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewOrderRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["order_id"] + val, ok := pathParams["order_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "order_id") } - protoReq.OrderId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "order_id", err) } - msg, err := server.ViewOrder(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_OrderService_ViewOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_OrderService_ViewOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_OrderService_ViewOrders_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewOrdersRequest - var metadata runtime.ServerMetadata - + var ( + protoReq ViewOrdersRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_ViewOrders_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OrderService_ViewOrders_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewOrdersRequest - var metadata runtime.ServerMetadata - + var ( + protoReq ViewOrdersRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_ViewOrders_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ViewOrders(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_OrderService_PlaceOrder_0 = &utilities.DoubleArray{Encoding: map[string]int{"cart": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} -) +var filter_OrderService_PlaceOrder_0 = &utilities.DoubleArray{Encoding: map[string]int{"cart": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} func request_OrderService_PlaceOrder_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PlaceOrderRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cart); err != nil && err != io.EOF { + var ( + protoReq PlaceOrderRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Cart); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_PlaceOrder_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.PlaceOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OrderService_PlaceOrder_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PlaceOrderRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cart); err != nil && err != io.EOF { + var ( + protoReq PlaceOrderRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Cart); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_PlaceOrder_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.PlaceOrder(ctx, &protoReq) return msg, metadata, err - } // RegisterOrderServiceHandlerServer registers the http handlers for service OrderService to "mux". // UnaryRPC :call OrderServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrderServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error { - - mux.Handle("GET", pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -216,20 +196,15 @@ func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -241,20 +216,15 @@ func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_ViewOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -266,20 +236,15 @@ func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_ViewOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -291,9 +256,7 @@ func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_PlaceOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -302,25 +265,24 @@ func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu // RegisterOrderServiceHandlerFromEndpoint is same as RegisterOrderServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterOrderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterOrderServiceHandler(ctx, mux, conn) } @@ -334,16 +296,13 @@ func RegisterOrderServiceHandler(ctx context.Context, mux *runtime.ServeMux, con // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrderServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrderServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "OrderServiceClient" to call the correct interceptors. +// "OrderServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderServiceClient) error { - - mux.Handle("GET", pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -354,18 +313,13 @@ func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -376,18 +330,13 @@ func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_ViewOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -398,18 +347,13 @@ func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_ViewOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -420,30 +364,21 @@ func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrderService_PlaceOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( pattern_OrderService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "service"}, "")) - - pattern_OrderService_ViewOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "order", "orders", "order_id"}, "")) - - pattern_OrderService_ViewOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "list"}, "")) - - pattern_OrderService_PlaceOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "place"}, "")) + pattern_OrderService_ViewOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "order", "orders", "order_id"}, "")) + pattern_OrderService_ViewOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "list"}, "")) + pattern_OrderService_PlaceOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "place"}, "")) ) var ( forward_OrderService_ServiceInfo_0 = runtime.ForwardResponseMessage - - forward_OrderService_ViewOrder_0 = runtime.ForwardResponseMessage - - forward_OrderService_ViewOrders_0 = runtime.ForwardResponseMessage - - forward_OrderService_PlaceOrder_0 = runtime.ForwardResponseMessage + forward_OrderService_ViewOrder_0 = runtime.ForwardResponseMessage + forward_OrderService_ViewOrders_0 = runtime.ForwardResponseMessage + forward_OrderService_PlaceOrder_0 = runtime.ForwardResponseMessage ) diff --git a/internal/pkg/protogen/order/v1/service_grpc.pb.go b/internal/pkg/protogen/order/v1/service_grpc.pb.go index b7c6b8d..0fdad41 100644 --- a/internal/pkg/protogen/order/v1/service_grpc.pb.go +++ b/internal/pkg/protogen/order/v1/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: stocklet/order/v1/service.proto @@ -33,8 +33,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( OrderService_ServiceInfo_FullMethodName = "/stocklet.order.v1.OrderService/ServiceInfo" @@ -95,8 +95,9 @@ func NewOrderServiceClient(cc grpc.ClientConnInterface) OrderServiceClient { } func (c *orderServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v1.ServiceInfoResponse) - err := c.cc.Invoke(ctx, OrderService_ServiceInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_ServiceInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -104,8 +105,9 @@ func (c *orderServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfo } func (c *orderServiceClient) ViewOrder(ctx context.Context, in *ViewOrderRequest, opts ...grpc.CallOption) (*ViewOrderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewOrderResponse) - err := c.cc.Invoke(ctx, OrderService_ViewOrder_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_ViewOrder_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -113,8 +115,9 @@ func (c *orderServiceClient) ViewOrder(ctx context.Context, in *ViewOrderRequest } func (c *orderServiceClient) ViewOrders(ctx context.Context, in *ViewOrdersRequest, opts ...grpc.CallOption) (*ViewOrdersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewOrdersResponse) - err := c.cc.Invoke(ctx, OrderService_ViewOrders_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_ViewOrders_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -122,8 +125,9 @@ func (c *orderServiceClient) ViewOrders(ctx context.Context, in *ViewOrdersReque } func (c *orderServiceClient) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PlaceOrderResponse) - err := c.cc.Invoke(ctx, OrderService_PlaceOrder_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_PlaceOrder_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -131,8 +135,9 @@ func (c *orderServiceClient) PlaceOrder(ctx context.Context, in *PlaceOrderReque } func (c *orderServiceClient) ProcessProductPriceQuoteEvent(ctx context.Context, in *v11.ProductPriceQuoteEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, OrderService_ProcessProductPriceQuoteEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_ProcessProductPriceQuoteEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -140,8 +145,9 @@ func (c *orderServiceClient) ProcessProductPriceQuoteEvent(ctx context.Context, } func (c *orderServiceClient) ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, OrderService_ProcessStockReservationEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_ProcessStockReservationEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -149,8 +155,9 @@ func (c *orderServiceClient) ProcessStockReservationEvent(ctx context.Context, i } func (c *orderServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, OrderService_ProcessShipmentAllocationEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_ProcessShipmentAllocationEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -158,8 +165,9 @@ func (c *orderServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, } func (c *orderServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, OrderService_ProcessPaymentProcessedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, OrderService_ProcessPaymentProcessedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -168,7 +176,7 @@ func (c *orderServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, i // OrderServiceServer is the server API for OrderService service. // All implementations must embed UnimplementedOrderServiceServer -// for forward compatibility +// for forward compatibility. type OrderServiceServer interface { // View information about the service. // @@ -206,35 +214,39 @@ type OrderServiceServer interface { mustEmbedUnimplementedOrderServiceServer() } -// UnimplementedOrderServiceServer must be embedded to have forward compatible implementations. -type UnimplementedOrderServiceServer struct { -} +// UnimplementedOrderServiceServer 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 UnimplementedOrderServiceServer struct{} func (UnimplementedOrderServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method ServiceInfo not implemented") } func (UnimplementedOrderServiceServer) ViewOrder(context.Context, *ViewOrderRequest) (*ViewOrderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewOrder not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewOrder not implemented") } func (UnimplementedOrderServiceServer) ViewOrders(context.Context, *ViewOrdersRequest) (*ViewOrdersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewOrders not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewOrders not implemented") } func (UnimplementedOrderServiceServer) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PlaceOrder not implemented") + return nil, status.Error(codes.Unimplemented, "method PlaceOrder not implemented") } func (UnimplementedOrderServiceServer) ProcessProductPriceQuoteEvent(context.Context, *v11.ProductPriceQuoteEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessProductPriceQuoteEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessProductPriceQuoteEvent not implemented") } func (UnimplementedOrderServiceServer) ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessStockReservationEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessStockReservationEvent not implemented") } func (UnimplementedOrderServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented") } func (UnimplementedOrderServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented") } func (UnimplementedOrderServiceServer) mustEmbedUnimplementedOrderServiceServer() {} +func (UnimplementedOrderServiceServer) testEmbeddedByValue() {} // UnsafeOrderServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to OrderServiceServer will @@ -244,6 +256,13 @@ type UnsafeOrderServiceServer interface { } func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer) { + // If the following call panics, it indicates UnimplementedOrderServiceServer 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(&OrderService_ServiceDesc, srv) } diff --git a/internal/pkg/protogen/order/v1/types.pb.go b/internal/pkg/protogen/order/v1/types.pb.go index ba1b67f..75a28d7 100644 --- a/internal/pkg/protogen/order/v1/types.pb.go +++ b/internal/pkg/protogen/order/v1/types.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/order/v1/types.proto @@ -27,6 +27,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -95,28 +96,25 @@ func (OrderStatus) EnumDescriptor() ([]byte, []int) { } type Order struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Status OrderStatus `protobuf:"varint,2,opt,name=status,proto3,enum=stocklet.order.v1.OrderStatus" json:"status,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Status OrderStatus `protobuf:"varint,2,opt,name=status,proto3,enum=stocklet.order.v1.OrderStatus" json:"status,omitempty"` // 'items' consists of a mapping of Product ID to Quantity. - Items map[string]int32 `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Items map[string]int32 `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` TransactionId *string `protobuf:"bytes,5,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"` ShippingId *string `protobuf:"bytes,6,opt,name=shipping_id,json=shippingId,proto3,oneof" json:"shipping_id,omitempty"` CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *int64 `protobuf:"varint,8,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Order) Reset() { *x = Order{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_order_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_order_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Order) String() string { @@ -127,7 +125,7 @@ func (*Order) ProtoMessage() {} func (x *Order) ProtoReflect() protoreflect.Message { mi := &file_stocklet_order_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -200,77 +198,53 @@ func (x *Order) GetUpdatedAt() int64 { var File_stocklet_order_v1_types_proto protoreflect.FileDescriptor -var file_stocklet_order_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x11, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xeb, 0x03, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x43, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x42, 0x0b, 0xba, 0x48, 0x08, 0x82, 0x01, 0x05, 0x10, 0x01, 0x22, 0x01, 0x00, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48, 0x09, - 0x9a, 0x01, 0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x0e, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0d, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, - 0x2d, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x01, 0x52, - 0x0a, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1d, - 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22, 0x0a, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x02, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, - 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0e, - 0x0a, 0x0c, 0x5f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x42, 0x0d, - 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x2a, 0xb4, 0x01, - 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, - 0x18, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4f, - 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x43, - 0x45, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, 0x44, 0x45, - 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, - 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a, - 0x15, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x50, - 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x52, 0x44, 0x45, - 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, - 0x45, 0x44, 0x10, 0x05, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, - 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_stocklet_order_v1_types_proto_rawDesc = "" + + "\n" + + "\x1dstocklet/order/v1/types.proto\x12\x11stocklet.order.v1\x1a\x1bbuf/validate/validate.proto\"\xea\x03\n" + + "\x05Order\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\x12B\n" + + "\x06status\x18\x02 \x01(\x0e2\x1e.stocklet.order.v1.OrderStatusB\n" + + "\xbaH\a\x82\x01\x04\x10\x01 \x00R\x06status\x12G\n" + + "\x05items\x18\x03 \x03(\v2#.stocklet.order.v1.Order.ItemsEntryB\f\xbaH\t\x9a\x01\x06*\x04\x1a\x02 \x00R\x05items\x12(\n" + + "\vcustomer_id\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "customerId\x123\n" + + "\x0etransaction_id\x18\x05 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\rtransactionId\x88\x01\x01\x12-\n" + + "\vshipping_id\x18\x06 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x01R\n" + + "shippingId\x88\x01\x01\x12\x1d\n" + + "\n" + + "created_at\x18\a \x01(\x03R\tcreatedAt\x12\"\n" + + "\n" + + "updated_at\x18\b \x01(\x03H\x02R\tupdatedAt\x88\x01\x01\x1a8\n" + + "\n" + + "ItemsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01B\x11\n" + + "\x0f_transaction_idB\x0e\n" + + "\f_shipping_idB\r\n" + + "\v_updated_at*\xb4\x01\n" + + "\vOrderStatus\x12\x1c\n" + + "\x18ORDER_STATUS_UNSPECIFIED\x10\x00\x12\x1b\n" + + "\x17ORDER_STATUS_PROCESSING\x10\x01\x12\x18\n" + + "\x14ORDER_STATUS_PENDING\x10\x02\x12\x19\n" + + "\x15ORDER_STATUS_REJECTED\x10\x03\x12\x19\n" + + "\x15ORDER_STATUS_APPROVED\x10\x04\x12\x1a\n" + + "\x16ORDER_STATUS_COMPLETED\x10\x05BEZCgithub.com/hexolan/stocklet/internal/pkg/protogen/order/v1;order_v1b\x06proto3" var ( file_stocklet_order_v1_types_proto_rawDescOnce sync.Once - file_stocklet_order_v1_types_proto_rawDescData = file_stocklet_order_v1_types_proto_rawDesc + file_stocklet_order_v1_types_proto_rawDescData []byte ) func file_stocklet_order_v1_types_proto_rawDescGZIP() []byte { file_stocklet_order_v1_types_proto_rawDescOnce.Do(func() { - file_stocklet_order_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_order_v1_types_proto_rawDescData) + file_stocklet_order_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_order_v1_types_proto_rawDesc), len(file_stocklet_order_v1_types_proto_rawDesc))) }) return file_stocklet_order_v1_types_proto_rawDescData } var file_stocklet_order_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_stocklet_order_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stocklet_order_v1_types_proto_goTypes = []interface{}{ +var file_stocklet_order_v1_types_proto_goTypes = []any{ (OrderStatus)(0), // 0: stocklet.order.v1.OrderStatus (*Order)(nil), // 1: stocklet.order.v1.Order nil, // 2: stocklet.order.v1.Order.ItemsEntry @@ -290,26 +264,12 @@ func file_stocklet_order_v1_types_proto_init() { if File_stocklet_order_v1_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_order_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Order); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_order_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_stocklet_order_v1_types_proto_msgTypes[0].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_order_v1_types_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_order_v1_types_proto_rawDesc), len(file_stocklet_order_v1_types_proto_rawDesc)), NumEnums: 1, NumMessages: 2, NumExtensions: 0, @@ -321,7 +281,6 @@ func file_stocklet_order_v1_types_proto_init() { MessageInfos: file_stocklet_order_v1_types_proto_msgTypes, }.Build() File_stocklet_order_v1_types_proto = out.File - file_stocklet_order_v1_types_proto_rawDesc = nil file_stocklet_order_v1_types_proto_goTypes = nil file_stocklet_order_v1_types_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/payment/v1/service.pb.go b/internal/pkg/protogen/payment/v1/service.pb.go index 6c2e705..019201e 100644 --- a/internal/pkg/protogen/payment/v1/service.pb.go +++ b/internal/pkg/protogen/payment/v1/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/payment/v1/service.proto @@ -32,6 +32,7 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -42,20 +43,17 @@ const ( ) type ViewTransactionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` unknownFields protoimpl.UnknownFields - - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewTransactionRequest) Reset() { *x = ViewTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_payment_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_payment_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewTransactionRequest) String() string { @@ -66,7 +64,7 @@ func (*ViewTransactionRequest) ProtoMessage() {} func (x *ViewTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_payment_v1_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -89,20 +87,17 @@ func (x *ViewTransactionRequest) GetTransactionId() string { } type ViewTransactionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` unknownFields protoimpl.UnknownFields - - Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewTransactionResponse) Reset() { *x = ViewTransactionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_payment_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_payment_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewTransactionResponse) String() string { @@ -113,7 +108,7 @@ func (*ViewTransactionResponse) ProtoMessage() {} func (x *ViewTransactionResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_payment_v1_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -136,20 +131,17 @@ func (x *ViewTransactionResponse) GetTransaction() *Transaction { } type ViewBalanceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` unknownFields protoimpl.UnknownFields - - CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewBalanceRequest) Reset() { *x = ViewBalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_payment_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_payment_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewBalanceRequest) String() string { @@ -160,7 +152,7 @@ func (*ViewBalanceRequest) ProtoMessage() {} func (x *ViewBalanceRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_payment_v1_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,20 +175,17 @@ func (x *ViewBalanceRequest) GetCustomerId() string { } type ViewBalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Balance *CustomerBalance `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` unknownFields protoimpl.UnknownFields - - Balance *CustomerBalance `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewBalanceResponse) Reset() { *x = ViewBalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_payment_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_payment_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewBalanceResponse) String() string { @@ -207,7 +196,7 @@ func (*ViewBalanceResponse) ProtoMessage() {} func (x *ViewBalanceResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_payment_v1_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -231,117 +220,43 @@ func (x *ViewBalanceResponse) GetBalance() *CustomerBalance { var File_stocklet_payment_v1_service_proto protoreflect.FileDescriptor -var file_stocklet_payment_v1_service_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, - 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x16, 0x56, 0x69, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, - 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0d, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5d, 0x0a, - 0x17, 0x56, 0x69, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x0a, 0x12, - 0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x13, - 0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x32, 0x8b, 0x06, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x9e, 0x01, 0x0a, 0x0f, 0x56, 0x69, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, - 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x8b, 0x01, 0x0a, 0x0b, 0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x12, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, - 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x7b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x7d, 0x12, 0x69, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, - 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x69, 0x0a, - 0x17, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, - 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x77, 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, - 0x4c, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, - 0x31, 0x3b, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_payment_v1_service_proto_rawDesc = "" + + "\n" + + "!stocklet/payment/v1/service.proto\x12\x13stocklet.payment.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a!stocklet/common/v1/requests.proto\x1a!stocklet/events/v1/shipping.proto\x1a\x1dstocklet/events/v1/user.proto\x1a\x1fstocklet/payment/v1/types.proto\"H\n" + + "\x16ViewTransactionRequest\x12.\n" + + "\x0etransaction_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\rtransactionId\"]\n" + + "\x17ViewTransactionResponse\x12B\n" + + "\vtransaction\x18\x01 \x01(\v2 .stocklet.payment.v1.TransactionR\vtransaction\">\n" + + "\x12ViewBalanceRequest\x12(\n" + + "\vcustomer_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "customerId\"U\n" + + "\x13ViewBalanceResponse\x12>\n" + + "\abalance\x18\x01 \x01(\v2$.stocklet.payment.v1.CustomerBalanceR\abalance2\x8b\x06\n" + + "\x0ePaymentService\x12{\n" + + "\vServiceInfo\x12&.stocklet.common.v1.ServiceInfoRequest\x1a'.stocklet.common.v1.ServiceInfoResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/payment/service\x12\x9e\x01\n" + + "\x0fViewTransaction\x12+.stocklet.payment.v1.ViewTransactionRequest\x1a,.stocklet.payment.v1.ViewTransactionResponse\"0\x82\xd3\xe4\x93\x02*\x12(/v1/payment/transaction/{transaction_id}\x12\x8b\x01\n" + + "\vViewBalance\x12'.stocklet.payment.v1.ViewBalanceRequest\x1a(.stocklet.payment.v1.ViewBalanceResponse\")\x82\xd3\xe4\x93\x02#\x12!/v1/payment/balance/{customer_id}\x12i\n" + + "\x17ProcessUserCreatedEvent\x12$.stocklet.events.v1.UserCreatedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12i\n" + + "\x17ProcessUserDeletedEvent\x12$.stocklet.events.v1.UserDeletedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12w\n" + + "\x1eProcessShipmentAllocationEvent\x12+.stocklet.events.v1.ShipmentAllocationEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNALBIZGgithub.com/hexolan/stocklet/internal/pkg/protogen/payment/v1;payment_v1b\x06proto3" var ( file_stocklet_payment_v1_service_proto_rawDescOnce sync.Once - file_stocklet_payment_v1_service_proto_rawDescData = file_stocklet_payment_v1_service_proto_rawDesc + file_stocklet_payment_v1_service_proto_rawDescData []byte ) func file_stocklet_payment_v1_service_proto_rawDescGZIP() []byte { file_stocklet_payment_v1_service_proto_rawDescOnce.Do(func() { - file_stocklet_payment_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_payment_v1_service_proto_rawDescData) + file_stocklet_payment_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_payment_v1_service_proto_rawDesc), len(file_stocklet_payment_v1_service_proto_rawDesc))) }) return file_stocklet_payment_v1_service_proto_rawDescData } var file_stocklet_payment_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_stocklet_payment_v1_service_proto_goTypes = []interface{}{ +var file_stocklet_payment_v1_service_proto_goTypes = []any{ (*ViewTransactionRequest)(nil), // 0: stocklet.payment.v1.ViewTransactionRequest (*ViewTransactionResponse)(nil), // 1: stocklet.payment.v1.ViewTransactionResponse (*ViewBalanceRequest)(nil), // 2: stocklet.payment.v1.ViewBalanceRequest @@ -383,61 +298,11 @@ func file_stocklet_payment_v1_service_proto_init() { return } file_stocklet_payment_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_stocklet_payment_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_payment_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewTransactionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_payment_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewBalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_payment_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewBalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_payment_v1_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_payment_v1_service_proto_rawDesc), len(file_stocklet_payment_v1_service_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -448,7 +313,6 @@ func file_stocklet_payment_v1_service_proto_init() { MessageInfos: file_stocklet_payment_v1_service_proto_msgTypes, }.Build() File_stocklet_payment_v1_service_proto = out.File - file_stocklet_payment_v1_service_proto_rawDesc = nil file_stocklet_payment_v1_service_proto_goTypes = nil file_stocklet_payment_v1_service_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/payment/v1/service.pb.gw.go b/internal/pkg/protogen/payment/v1/service.pb.gw.go index 5516c59..a6f0176 100644 --- a/internal/pkg/protogen/payment/v1/service.pb.gw.go +++ b/internal/pkg/protogen/payment/v1/service.pb.gw.go @@ -10,6 +10,7 @@ package payment_v1 import ( "context" + "errors" "io" "net/http" @@ -25,150 +26,128 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_PaymentService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client PaymentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_PaymentService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server PaymentServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) msg, err := server.ServiceInfo(ctx, &protoReq) return msg, metadata, err - } func request_PaymentService_ViewTransaction_0(ctx context.Context, marshaler runtime.Marshaler, client PaymentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewTransactionRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewTransactionRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["transaction_id"] + val, ok := pathParams["transaction_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "transaction_id") } - protoReq.TransactionId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "transaction_id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewTransaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_PaymentService_ViewTransaction_0(ctx context.Context, marshaler runtime.Marshaler, server PaymentServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewTransactionRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewTransactionRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["transaction_id"] + val, ok := pathParams["transaction_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "transaction_id") } - protoReq.TransactionId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "transaction_id", err) } - msg, err := server.ViewTransaction(ctx, &protoReq) return msg, metadata, err - } func request_PaymentService_ViewBalance_0(ctx context.Context, marshaler runtime.Marshaler, client PaymentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewBalanceRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewBalanceRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["customer_id"] + val, ok := pathParams["customer_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "customer_id") } - protoReq.CustomerId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "customer_id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewBalance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_PaymentService_ViewBalance_0(ctx context.Context, marshaler runtime.Marshaler, server PaymentServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewBalanceRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewBalanceRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["customer_id"] + val, ok := pathParams["customer_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "customer_id") } - protoReq.CustomerId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "customer_id", err) } - msg, err := server.ViewBalance(ctx, &protoReq) return msg, metadata, err - } // RegisterPaymentServiceHandlerServer registers the http handlers for service PaymentService to "mux". // UnaryRPC :call PaymentServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPaymentServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PaymentServiceServer) error { - - mux.Handle("GET", pattern_PaymentService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PaymentService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/payment/service")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/payment/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -180,20 +159,15 @@ func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PaymentService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_PaymentService_ViewTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PaymentService_ViewTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewTransaction", runtime.WithHTTPPathPattern("/v1/payment/transaction/{transaction_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewTransaction", runtime.WithHTTPPathPattern("/v1/payment/transaction/{transaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -205,20 +179,15 @@ func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PaymentService_ViewTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_PaymentService_ViewBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PaymentService_ViewBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewBalance", runtime.WithHTTPPathPattern("/v1/payment/balance/{customer_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewBalance", runtime.WithHTTPPathPattern("/v1/payment/balance/{customer_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -230,9 +199,7 @@ func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PaymentService_ViewBalance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -241,25 +208,24 @@ func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.Serve // RegisterPaymentServiceHandlerFromEndpoint is same as RegisterPaymentServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterPaymentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterPaymentServiceHandler(ctx, mux, conn) } @@ -273,16 +239,13 @@ func RegisterPaymentServiceHandler(ctx context.Context, mux *runtime.ServeMux, c // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PaymentServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PaymentServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "PaymentServiceClient" to call the correct interceptors. +// "PaymentServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PaymentServiceClient) error { - - mux.Handle("GET", pattern_PaymentService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PaymentService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/payment/service")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/payment/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -293,18 +256,13 @@ func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PaymentService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_PaymentService_ViewTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PaymentService_ViewTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewTransaction", runtime.WithHTTPPathPattern("/v1/payment/transaction/{transaction_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewTransaction", runtime.WithHTTPPathPattern("/v1/payment/transaction/{transaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -315,18 +273,13 @@ func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PaymentService_ViewTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_PaymentService_ViewBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PaymentService_ViewBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewBalance", runtime.WithHTTPPathPattern("/v1/payment/balance/{customer_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewBalance", runtime.WithHTTPPathPattern("/v1/payment/balance/{customer_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -337,26 +290,19 @@ func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PaymentService_ViewBalance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_PaymentService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payment", "service"}, "")) - + pattern_PaymentService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payment", "service"}, "")) pattern_PaymentService_ViewTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payment", "transaction", "transaction_id"}, "")) - - pattern_PaymentService_ViewBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payment", "balance", "customer_id"}, "")) + pattern_PaymentService_ViewBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payment", "balance", "customer_id"}, "")) ) var ( - forward_PaymentService_ServiceInfo_0 = runtime.ForwardResponseMessage - + forward_PaymentService_ServiceInfo_0 = runtime.ForwardResponseMessage forward_PaymentService_ViewTransaction_0 = runtime.ForwardResponseMessage - - forward_PaymentService_ViewBalance_0 = runtime.ForwardResponseMessage + forward_PaymentService_ViewBalance_0 = runtime.ForwardResponseMessage ) diff --git a/internal/pkg/protogen/payment/v1/service_grpc.pb.go b/internal/pkg/protogen/payment/v1/service_grpc.pb.go index 5a2c531..f283794 100644 --- a/internal/pkg/protogen/payment/v1/service_grpc.pb.go +++ b/internal/pkg/protogen/payment/v1/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: stocklet/payment/v1/service.proto @@ -33,8 +33,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( PaymentService_ServiceInfo_FullMethodName = "/stocklet.payment.v1.PaymentService/ServiceInfo" @@ -84,8 +84,9 @@ func NewPaymentServiceClient(cc grpc.ClientConnInterface) PaymentServiceClient { } func (c *paymentServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v1.ServiceInfoResponse) - err := c.cc.Invoke(ctx, PaymentService_ServiceInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PaymentService_ServiceInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -93,8 +94,9 @@ func (c *paymentServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceIn } func (c *paymentServiceClient) ViewTransaction(ctx context.Context, in *ViewTransactionRequest, opts ...grpc.CallOption) (*ViewTransactionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewTransactionResponse) - err := c.cc.Invoke(ctx, PaymentService_ViewTransaction_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PaymentService_ViewTransaction_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -102,8 +104,9 @@ func (c *paymentServiceClient) ViewTransaction(ctx context.Context, in *ViewTran } func (c *paymentServiceClient) ViewBalance(ctx context.Context, in *ViewBalanceRequest, opts ...grpc.CallOption) (*ViewBalanceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewBalanceResponse) - err := c.cc.Invoke(ctx, PaymentService_ViewBalance_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PaymentService_ViewBalance_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -111,8 +114,9 @@ func (c *paymentServiceClient) ViewBalance(ctx context.Context, in *ViewBalanceR } func (c *paymentServiceClient) ProcessUserCreatedEvent(ctx context.Context, in *v11.UserCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, PaymentService_ProcessUserCreatedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PaymentService_ProcessUserCreatedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -120,8 +124,9 @@ func (c *paymentServiceClient) ProcessUserCreatedEvent(ctx context.Context, in * } func (c *paymentServiceClient) ProcessUserDeletedEvent(ctx context.Context, in *v11.UserDeletedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, PaymentService_ProcessUserDeletedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PaymentService_ProcessUserDeletedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -129,8 +134,9 @@ func (c *paymentServiceClient) ProcessUserDeletedEvent(ctx context.Context, in * } func (c *paymentServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, PaymentService_ProcessShipmentAllocationEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PaymentService_ProcessShipmentAllocationEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -139,7 +145,7 @@ func (c *paymentServiceClient) ProcessShipmentAllocationEvent(ctx context.Contex // PaymentServiceServer is the server API for PaymentService service. // All implementations must embed UnimplementedPaymentServiceServer -// for forward compatibility +// for forward compatibility. type PaymentServiceServer interface { // View information about the service. // @@ -168,29 +174,33 @@ type PaymentServiceServer interface { mustEmbedUnimplementedPaymentServiceServer() } -// UnimplementedPaymentServiceServer must be embedded to have forward compatible implementations. -type UnimplementedPaymentServiceServer struct { -} +// UnimplementedPaymentServiceServer 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 UnimplementedPaymentServiceServer struct{} func (UnimplementedPaymentServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method ServiceInfo not implemented") } func (UnimplementedPaymentServiceServer) ViewTransaction(context.Context, *ViewTransactionRequest) (*ViewTransactionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewTransaction not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewTransaction not implemented") } func (UnimplementedPaymentServiceServer) ViewBalance(context.Context, *ViewBalanceRequest) (*ViewBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewBalance not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewBalance not implemented") } func (UnimplementedPaymentServiceServer) ProcessUserCreatedEvent(context.Context, *v11.UserCreatedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessUserCreatedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessUserCreatedEvent not implemented") } func (UnimplementedPaymentServiceServer) ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessUserDeletedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessUserDeletedEvent not implemented") } func (UnimplementedPaymentServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented") } func (UnimplementedPaymentServiceServer) mustEmbedUnimplementedPaymentServiceServer() {} +func (UnimplementedPaymentServiceServer) testEmbeddedByValue() {} // UnsafePaymentServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PaymentServiceServer will @@ -200,6 +210,13 @@ type UnsafePaymentServiceServer interface { } func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer) { + // If the following call panics, it indicates UnimplementedPaymentServiceServer 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(&PaymentService_ServiceDesc, srv) } diff --git a/internal/pkg/protogen/payment/v1/types.pb.go b/internal/pkg/protogen/payment/v1/types.pb.go index ad04d94..fcf9ea4 100644 --- a/internal/pkg/protogen/payment/v1/types.pb.go +++ b/internal/pkg/protogen/payment/v1/types.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/payment/v1/types.proto @@ -27,6 +27,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -37,26 +38,23 @@ const ( ) type Transaction struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Amount float32 `protobuf:"fixed32,2,opt,name=amount,proto3" json:"amount,omitempty"` - OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Amount float32 `protobuf:"fixed32,2,opt,name=amount,proto3" json:"amount,omitempty"` + OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // Optional - If set, then the transaction has been refunded. - ReversedAt *int64 `protobuf:"varint,5,opt,name=reversed_at,json=reversedAt,proto3,oneof" json:"reversed_at,omitempty"` - ProcessedAt int64 `protobuf:"varint,6,opt,name=processed_at,json=processedAt,proto3" json:"processed_at,omitempty"` + ReversedAt *int64 `protobuf:"varint,5,opt,name=reversed_at,json=reversedAt,proto3,oneof" json:"reversed_at,omitempty"` + ProcessedAt int64 `protobuf:"varint,6,opt,name=processed_at,json=processedAt,proto3" json:"processed_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Transaction) Reset() { *x = Transaction{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_payment_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_payment_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Transaction) String() string { @@ -67,7 +65,7 @@ func (*Transaction) ProtoMessage() {} func (x *Transaction) ProtoReflect() protoreflect.Message { mi := &file_stocklet_payment_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -125,21 +123,18 @@ func (x *Transaction) GetProcessedAt() int64 { } type CustomerBalance struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + Balance float32 `protobuf:"fixed32,2,opt,name=balance,proto3" json:"balance,omitempty"` unknownFields protoimpl.UnknownFields - - CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` - Balance float32 `protobuf:"fixed32,2,opt,name=balance,proto3" json:"balance,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CustomerBalance) Reset() { *x = CustomerBalance{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_payment_v1_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_payment_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CustomerBalance) String() string { @@ -150,7 +145,7 @@ func (*CustomerBalance) ProtoMessage() {} func (x *CustomerBalance) ProtoReflect() protoreflect.Message { mi := &file_stocklet_payment_v1_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -181,55 +176,42 @@ func (x *CustomerBalance) GetBalance() float32 { var File_stocklet_payment_v1_types_proto protoreflect.FileDescriptor -var file_stocklet_payment_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xf1, 0x01, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x42, 0x0a, 0xba, 0x48, - 0x07, 0x0a, 0x05, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x22, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, - 0x0a, 0x0b, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x64, 0x41, - 0x74, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x65, 0x64, 0x41, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x72, 0x65, 0x76, 0x65, - 0x72, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x22, 0x61, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x02, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x0a, 0x05, 0x2d, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, - 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x61, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_payment_v1_types_proto_rawDesc = "" + + "\n" + + "\x1fstocklet/payment/v1/types.proto\x12\x13stocklet.payment.v1\x1a\x1bbuf/validate/validate.proto\"\xf1\x01\n" + + "\vTransaction\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\x12\"\n" + + "\x06amount\x18\x02 \x01(\x02B\n" + + "\xbaH\a\n" + + "\x05-\x00\x00\x00\x00R\x06amount\x12\"\n" + + "\border_id\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\aorderId\x12(\n" + + "\vcustomer_id\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "customerId\x12$\n" + + "\vreversed_at\x18\x05 \x01(\x03H\x00R\n" + + "reversedAt\x88\x01\x01\x12!\n" + + "\fprocessed_at\x18\x06 \x01(\x03R\vprocessedAtB\x0e\n" + + "\f_reversed_at\"a\n" + + "\x0fCustomerBalance\x12(\n" + + "\vcustomer_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "customerId\x12$\n" + + "\abalance\x18\x02 \x01(\x02B\n" + + "\xbaH\a\n" + + "\x05-\x00\x00\x00\x00R\abalanceBIZGgithub.com/hexolan/stocklet/internal/pkg/protogen/payment/v1;payment_v1b\x06proto3" var ( file_stocklet_payment_v1_types_proto_rawDescOnce sync.Once - file_stocklet_payment_v1_types_proto_rawDescData = file_stocklet_payment_v1_types_proto_rawDesc + file_stocklet_payment_v1_types_proto_rawDescData []byte ) func file_stocklet_payment_v1_types_proto_rawDescGZIP() []byte { file_stocklet_payment_v1_types_proto_rawDescOnce.Do(func() { - file_stocklet_payment_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_payment_v1_types_proto_rawDescData) + file_stocklet_payment_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_payment_v1_types_proto_rawDesc), len(file_stocklet_payment_v1_types_proto_rawDesc))) }) return file_stocklet_payment_v1_types_proto_rawDescData } var file_stocklet_payment_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stocklet_payment_v1_types_proto_goTypes = []interface{}{ +var file_stocklet_payment_v1_types_proto_goTypes = []any{ (*Transaction)(nil), // 0: stocklet.payment.v1.Transaction (*CustomerBalance)(nil), // 1: stocklet.payment.v1.CustomerBalance } @@ -246,38 +228,12 @@ func file_stocklet_payment_v1_types_proto_init() { if File_stocklet_payment_v1_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_payment_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_payment_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CustomerBalance); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_payment_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_stocklet_payment_v1_types_proto_msgTypes[0].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_payment_v1_types_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_payment_v1_types_proto_rawDesc), len(file_stocklet_payment_v1_types_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -288,7 +244,6 @@ func file_stocklet_payment_v1_types_proto_init() { MessageInfos: file_stocklet_payment_v1_types_proto_msgTypes, }.Build() File_stocklet_payment_v1_types_proto = out.File - file_stocklet_payment_v1_types_proto_rawDesc = nil file_stocklet_payment_v1_types_proto_goTypes = nil file_stocklet_payment_v1_types_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/product/v1/service.pb.go b/internal/pkg/protogen/product/v1/service.pb.go index bc05889..669986d 100644 --- a/internal/pkg/protogen/product/v1/service.pb.go +++ b/internal/pkg/protogen/product/v1/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/product/v1/service.proto @@ -32,6 +32,7 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -42,20 +43,17 @@ const ( ) type ViewProductRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewProductRequest) Reset() { *x = ViewProductRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_product_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_product_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewProductRequest) String() string { @@ -66,7 +64,7 @@ func (*ViewProductRequest) ProtoMessage() {} func (x *ViewProductRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_product_v1_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -89,20 +87,17 @@ func (x *ViewProductRequest) GetId() string { } type ViewProductResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"` unknownFields protoimpl.UnknownFields - - Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewProductResponse) Reset() { *x = ViewProductResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_product_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_product_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewProductResponse) String() string { @@ -113,7 +108,7 @@ func (*ViewProductResponse) ProtoMessage() {} func (x *ViewProductResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_product_v1_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -136,18 +131,16 @@ func (x *ViewProductResponse) GetProduct() *Product { } type ViewProductsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ViewProductsRequest) Reset() { *x = ViewProductsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_product_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_product_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewProductsRequest) String() string { @@ -158,7 +151,7 @@ func (*ViewProductsRequest) ProtoMessage() {} func (x *ViewProductsRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_product_v1_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -174,20 +167,17 @@ func (*ViewProductsRequest) Descriptor() ([]byte, []int) { } type ViewProductsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` unknownFields protoimpl.UnknownFields - - Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewProductsResponse) Reset() { *x = ViewProductsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_product_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_product_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewProductsResponse) String() string { @@ -198,7 +188,7 @@ func (*ViewProductsResponse) ProtoMessage() {} func (x *ViewProductsResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_product_v1_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -222,92 +212,37 @@ func (x *ViewProductsResponse) GetProducts() []*Product { var File_stocklet_product_v1_service_proto protoreflect.FileDescriptor -var file_stocklet_product_v1_service_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, - 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x2d, 0x0a, 0x12, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x4d, 0x0a, 0x13, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x22, - 0x15, 0x0a, 0x13, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x14, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, - 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x08, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x32, 0xf5, 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0b, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7a, 0x0a, 0x0b, 0x56, 0x69, 0x65, 0x77, - 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, - 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x28, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x73, 0x12, 0x28, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, - 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f, 0x6c, - 0x69, 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, - 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, - 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, - 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f, 0x76, 0x31, - 0x3b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_stocklet_product_v1_service_proto_rawDesc = "" + + "\n" + + "!stocklet/product/v1/service.proto\x12\x13stocklet.product.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a!stocklet/common/v1/requests.proto\x1a\x1estocklet/events/v1/order.proto\x1a\x1fstocklet/product/v1/types.proto\"-\n" + + "\x12ViewProductRequest\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\"M\n" + + "\x13ViewProductResponse\x126\n" + + "\aproduct\x18\x01 \x01(\v2\x1c.stocklet.product.v1.ProductR\aproduct\"\x15\n" + + "\x13ViewProductsRequest\"P\n" + + "\x14ViewProductsResponse\x128\n" + + "\bproducts\x18\x01 \x03(\v2\x1c.stocklet.product.v1.ProductR\bproducts2\xf5\x03\n" + + "\x0eProductService\x12{\n" + + "\vServiceInfo\x12&.stocklet.common.v1.ServiceInfoRequest\x1a'.stocklet.common.v1.ServiceInfoResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/product/service\x12z\n" + + "\vViewProduct\x12'.stocklet.product.v1.ViewProductRequest\x1a(.stocklet.product.v1.ViewProductResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/product/{id}\x12}\n" + + "\fViewProducts\x12(.stocklet.product.v1.ViewProductsRequest\x1a).stocklet.product.v1.ViewProductsResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/product/list\x12k\n" + + "\x18ProcessOrderCreatedEvent\x12%.stocklet.events.v1.OrderCreatedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNALBIZGgithub.com/hexolan/stocklet/internal/pkg/protogen/product/v1;product_v1b\x06proto3" var ( file_stocklet_product_v1_service_proto_rawDescOnce sync.Once - file_stocklet_product_v1_service_proto_rawDescData = file_stocklet_product_v1_service_proto_rawDesc + file_stocklet_product_v1_service_proto_rawDescData []byte ) func file_stocklet_product_v1_service_proto_rawDescGZIP() []byte { file_stocklet_product_v1_service_proto_rawDescOnce.Do(func() { - file_stocklet_product_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_product_v1_service_proto_rawDescData) + file_stocklet_product_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_product_v1_service_proto_rawDesc), len(file_stocklet_product_v1_service_proto_rawDesc))) }) return file_stocklet_product_v1_service_proto_rawDescData } var file_stocklet_product_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_stocklet_product_v1_service_proto_goTypes = []interface{}{ +var file_stocklet_product_v1_service_proto_goTypes = []any{ (*ViewProductRequest)(nil), // 0: stocklet.product.v1.ViewProductRequest (*ViewProductResponse)(nil), // 1: stocklet.product.v1.ViewProductResponse (*ViewProductsRequest)(nil), // 2: stocklet.product.v1.ViewProductsRequest @@ -342,61 +277,11 @@ func file_stocklet_product_v1_service_proto_init() { return } file_stocklet_product_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_stocklet_product_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewProductRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_product_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewProductResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_product_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewProductsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_product_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewProductsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_product_v1_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_product_v1_service_proto_rawDesc), len(file_stocklet_product_v1_service_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -407,7 +292,6 @@ func file_stocklet_product_v1_service_proto_init() { MessageInfos: file_stocklet_product_v1_service_proto_msgTypes, }.Build() File_stocklet_product_v1_service_proto = out.File - file_stocklet_product_v1_service_proto_rawDesc = nil file_stocklet_product_v1_service_proto_goTypes = nil file_stocklet_product_v1_service_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/product/v1/service.pb.gw.go b/internal/pkg/protogen/product/v1/service.pb.gw.go index 5d54a5b..11e2d0e 100644 --- a/internal/pkg/protogen/product/v1/service.pb.gw.go +++ b/internal/pkg/protogen/product/v1/service.pb.gw.go @@ -10,6 +10,7 @@ package product_v1 import ( "context" + "errors" "io" "net/http" @@ -25,116 +26,110 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_ProductService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ProductServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ProductService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ProductServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) msg, err := server.ServiceInfo(ctx, &protoReq) return msg, metadata, err - } func request_ProductService_ViewProduct_0(ctx context.Context, marshaler runtime.Marshaler, client ProductServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewProductRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewProductRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewProduct(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ProductService_ViewProduct_0(ctx context.Context, marshaler runtime.Marshaler, server ProductServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewProductRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewProductRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.ViewProduct(ctx, &protoReq) return msg, metadata, err - } func request_ProductService_ViewProducts_0(ctx context.Context, marshaler runtime.Marshaler, client ProductServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewProductsRequest - var metadata runtime.ServerMetadata - + var ( + protoReq ViewProductsRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewProducts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ProductService_ViewProducts_0(ctx context.Context, marshaler runtime.Marshaler, server ProductServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewProductsRequest - var metadata runtime.ServerMetadata - + var ( + protoReq ViewProductsRequest + metadata runtime.ServerMetadata + ) msg, err := server.ViewProducts(ctx, &protoReq) return msg, metadata, err - } // RegisterProductServiceHandlerServer registers the http handlers for service ProductService to "mux". // UnaryRPC :call ProductServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterProductServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProductServiceServer) error { - - mux.Handle("GET", pattern_ProductService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ProductService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/product/service")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/product/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -146,20 +141,15 @@ func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ProductService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ProductService_ViewProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ProductService_ViewProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProduct", runtime.WithHTTPPathPattern("/v1/product/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProduct", runtime.WithHTTPPathPattern("/v1/product/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -171,20 +161,15 @@ func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ProductService_ViewProduct_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ProductService_ViewProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ProductService_ViewProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProducts", runtime.WithHTTPPathPattern("/v1/product/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProducts", runtime.WithHTTPPathPattern("/v1/product/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -196,9 +181,7 @@ func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ProductService_ViewProducts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -207,25 +190,24 @@ func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.Serve // RegisterProductServiceHandlerFromEndpoint is same as RegisterProductServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterProductServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterProductServiceHandler(ctx, mux, conn) } @@ -239,16 +221,13 @@ func RegisterProductServiceHandler(ctx context.Context, mux *runtime.ServeMux, c // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProductServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProductServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ProductServiceClient" to call the correct interceptors. +// "ProductServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProductServiceClient) error { - - mux.Handle("GET", pattern_ProductService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ProductService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/product/service")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/product/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -259,18 +238,13 @@ func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ProductService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ProductService_ViewProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ProductService_ViewProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProduct", runtime.WithHTTPPathPattern("/v1/product/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProduct", runtime.WithHTTPPathPattern("/v1/product/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -281,18 +255,13 @@ func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ProductService_ViewProduct_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ProductService_ViewProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ProductService_ViewProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProducts", runtime.WithHTTPPathPattern("/v1/product/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProducts", runtime.WithHTTPPathPattern("/v1/product/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -303,26 +272,19 @@ func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ProductService_ViewProducts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_ProductService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "product", "service"}, "")) - - pattern_ProductService_ViewProduct_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "product", "id"}, "")) - + pattern_ProductService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "product", "service"}, "")) + pattern_ProductService_ViewProduct_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "product", "id"}, "")) pattern_ProductService_ViewProducts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "product", "list"}, "")) ) var ( - forward_ProductService_ServiceInfo_0 = runtime.ForwardResponseMessage - - forward_ProductService_ViewProduct_0 = runtime.ForwardResponseMessage - + forward_ProductService_ServiceInfo_0 = runtime.ForwardResponseMessage + forward_ProductService_ViewProduct_0 = runtime.ForwardResponseMessage forward_ProductService_ViewProducts_0 = runtime.ForwardResponseMessage ) diff --git a/internal/pkg/protogen/product/v1/service_grpc.pb.go b/internal/pkg/protogen/product/v1/service_grpc.pb.go index 0fa14b3..4503298 100644 --- a/internal/pkg/protogen/product/v1/service_grpc.pb.go +++ b/internal/pkg/protogen/product/v1/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: stocklet/product/v1/service.proto @@ -33,8 +33,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ProductService_ServiceInfo_FullMethodName = "/stocklet.product.v1.ProductService/ServiceInfo" @@ -70,8 +70,9 @@ func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient { } func (c *productServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v1.ServiceInfoResponse) - err := c.cc.Invoke(ctx, ProductService_ServiceInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ProductService_ServiceInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -79,8 +80,9 @@ func (c *productServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceIn } func (c *productServiceClient) ViewProduct(ctx context.Context, in *ViewProductRequest, opts ...grpc.CallOption) (*ViewProductResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewProductResponse) - err := c.cc.Invoke(ctx, ProductService_ViewProduct_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ProductService_ViewProduct_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -88,8 +90,9 @@ func (c *productServiceClient) ViewProduct(ctx context.Context, in *ViewProductR } func (c *productServiceClient) ViewProducts(ctx context.Context, in *ViewProductsRequest, opts ...grpc.CallOption) (*ViewProductsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewProductsResponse) - err := c.cc.Invoke(ctx, ProductService_ViewProducts_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ProductService_ViewProducts_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -97,8 +100,9 @@ func (c *productServiceClient) ViewProducts(ctx context.Context, in *ViewProduct } func (c *productServiceClient) ProcessOrderCreatedEvent(ctx context.Context, in *v11.OrderCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, ProductService_ProcessOrderCreatedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ProductService_ProcessOrderCreatedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -107,7 +111,7 @@ func (c *productServiceClient) ProcessOrderCreatedEvent(ctx context.Context, in // ProductServiceServer is the server API for ProductService service. // All implementations must embed UnimplementedProductServiceServer -// for forward compatibility +// for forward compatibility. type ProductServiceServer interface { // View information about the service. // @@ -124,23 +128,27 @@ type ProductServiceServer interface { mustEmbedUnimplementedProductServiceServer() } -// UnimplementedProductServiceServer must be embedded to have forward compatible implementations. -type UnimplementedProductServiceServer struct { -} +// UnimplementedProductServiceServer 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 UnimplementedProductServiceServer struct{} func (UnimplementedProductServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method ServiceInfo not implemented") } func (UnimplementedProductServiceServer) ViewProduct(context.Context, *ViewProductRequest) (*ViewProductResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewProduct not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewProduct not implemented") } func (UnimplementedProductServiceServer) ViewProducts(context.Context, *ViewProductsRequest) (*ViewProductsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewProducts not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewProducts not implemented") } func (UnimplementedProductServiceServer) ProcessOrderCreatedEvent(context.Context, *v11.OrderCreatedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessOrderCreatedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessOrderCreatedEvent not implemented") } func (UnimplementedProductServiceServer) mustEmbedUnimplementedProductServiceServer() {} +func (UnimplementedProductServiceServer) testEmbeddedByValue() {} // UnsafeProductServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ProductServiceServer will @@ -150,6 +158,13 @@ type UnsafeProductServiceServer interface { } func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer) { + // If the following call panics, it indicates UnimplementedProductServiceServer 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(&ProductService_ServiceDesc, srv) } diff --git a/internal/pkg/protogen/product/v1/types.pb.go b/internal/pkg/protogen/product/v1/types.pb.go index bf75bb2..61d0c3e 100644 --- a/internal/pkg/protogen/product/v1/types.pb.go +++ b/internal/pkg/protogen/product/v1/types.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/product/v1/types.proto @@ -27,6 +27,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -37,25 +38,22 @@ const ( ) type Product struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Price float32 `protobuf:"fixed32,4,opt,name=price,proto3" json:"price,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Price float32 `protobuf:"fixed32,4,opt,name=price,proto3" json:"price,omitempty"` - CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Product) Reset() { *x = Product{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_product_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_product_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Product) String() string { @@ -66,7 +64,7 @@ func (*Product) ProtoMessage() {} func (x *Product) ProtoReflect() protoreflect.Message { mi := &file_stocklet_product_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -125,48 +123,36 @@ func (x *Product) GetUpdatedAt() int64 { var File_stocklet_product_v1_types_proto protoreflect.FileDescriptor -var file_stocklet_product_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, - 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x20, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x42, - 0x0a, 0xba, 0x48, 0x07, 0x0a, 0x05, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x52, 0x05, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x22, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_product_v1_types_proto_rawDesc = "" + + "\n" + + "\x1fstocklet/product/v1/types.proto\x12\x13stocklet.product.v1\x1a\x1bbuf/validate/validate.proto\"\xde\x01\n" + + "\aProduct\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12)\n" + + "\vdescription\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\vdescription\x12 \n" + + "\x05price\x18\x04 \x01(\x02B\n" + + "\xbaH\a\n" + + "\x05-\x00\x00\x00\x00R\x05price\x12\x1d\n" + + "\n" + + "created_at\x18\x05 \x01(\x03R\tcreatedAt\x12\"\n" + + "\n" + + "updated_at\x18\x06 \x01(\x03H\x00R\tupdatedAt\x88\x01\x01B\r\n" + + "\v_updated_atBIZGgithub.com/hexolan/stocklet/internal/pkg/protogen/product/v1;product_v1b\x06proto3" var ( file_stocklet_product_v1_types_proto_rawDescOnce sync.Once - file_stocklet_product_v1_types_proto_rawDescData = file_stocklet_product_v1_types_proto_rawDesc + file_stocklet_product_v1_types_proto_rawDescData []byte ) func file_stocklet_product_v1_types_proto_rawDescGZIP() []byte { file_stocklet_product_v1_types_proto_rawDescOnce.Do(func() { - file_stocklet_product_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_product_v1_types_proto_rawDescData) + file_stocklet_product_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_product_v1_types_proto_rawDesc), len(file_stocklet_product_v1_types_proto_rawDesc))) }) return file_stocklet_product_v1_types_proto_rawDescData } var file_stocklet_product_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_stocklet_product_v1_types_proto_goTypes = []interface{}{ +var file_stocklet_product_v1_types_proto_goTypes = []any{ (*Product)(nil), // 0: stocklet.product.v1.Product } var file_stocklet_product_v1_types_proto_depIdxs = []int32{ @@ -182,26 +168,12 @@ func file_stocklet_product_v1_types_proto_init() { if File_stocklet_product_v1_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_product_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Product); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_product_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_stocklet_product_v1_types_proto_msgTypes[0].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_product_v1_types_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_product_v1_types_proto_rawDesc), len(file_stocklet_product_v1_types_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -212,7 +184,6 @@ func file_stocklet_product_v1_types_proto_init() { MessageInfos: file_stocklet_product_v1_types_proto_msgTypes, }.Build() File_stocklet_product_v1_types_proto = out.File - file_stocklet_product_v1_types_proto_rawDesc = nil file_stocklet_product_v1_types_proto_goTypes = nil file_stocklet_product_v1_types_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/shipping/v1/service.pb.go b/internal/pkg/protogen/shipping/v1/service.pb.go index 27c9c57..f7c428a 100644 --- a/internal/pkg/protogen/shipping/v1/service.pb.go +++ b/internal/pkg/protogen/shipping/v1/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/shipping/v1/service.proto @@ -32,6 +32,7 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -42,20 +43,17 @@ const ( ) type ViewShipmentRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` unknownFields protoimpl.UnknownFields - - ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewShipmentRequest) Reset() { *x = ViewShipmentRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_shipping_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_shipping_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewShipmentRequest) String() string { @@ -66,7 +64,7 @@ func (*ViewShipmentRequest) ProtoMessage() {} func (x *ViewShipmentRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_shipping_v1_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -89,20 +87,17 @@ func (x *ViewShipmentRequest) GetShipmentId() string { } type ViewShipmentResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Shipment *Shipment `protobuf:"bytes,1,opt,name=shipment,proto3" json:"shipment,omitempty"` unknownFields protoimpl.UnknownFields - - Shipment *Shipment `protobuf:"bytes,1,opt,name=shipment,proto3" json:"shipment,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewShipmentResponse) Reset() { *x = ViewShipmentResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_shipping_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_shipping_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewShipmentResponse) String() string { @@ -113,7 +108,7 @@ func (*ViewShipmentResponse) ProtoMessage() {} func (x *ViewShipmentResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_shipping_v1_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -136,20 +131,17 @@ func (x *ViewShipmentResponse) GetShipment() *Shipment { } type ViewShipmentManifestRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` unknownFields protoimpl.UnknownFields - - ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewShipmentManifestRequest) Reset() { *x = ViewShipmentManifestRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_shipping_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_shipping_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewShipmentManifestRequest) String() string { @@ -160,7 +152,7 @@ func (*ViewShipmentManifestRequest) ProtoMessage() {} func (x *ViewShipmentManifestRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_shipping_v1_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,20 +175,17 @@ func (x *ViewShipmentManifestRequest) GetShipmentId() string { } type ViewShipmentManifestResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Manifest []*ShipmentItem `protobuf:"bytes,1,rep,name=manifest,proto3" json:"manifest,omitempty"` unknownFields protoimpl.UnknownFields - - Manifest []*ShipmentItem `protobuf:"bytes,1,rep,name=manifest,proto3" json:"manifest,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewShipmentManifestResponse) Reset() { *x = ViewShipmentManifestResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_shipping_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_shipping_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewShipmentManifestResponse) String() string { @@ -207,7 +196,7 @@ func (*ViewShipmentManifestResponse) ProtoMessage() {} func (x *ViewShipmentManifestResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_shipping_v1_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -231,113 +220,42 @@ func (x *ViewShipmentManifestResponse) GetManifest() []*ShipmentItem { var File_stocklet_shipping_v1_service_proto protoreflect.FileDescriptor -var file_stocklet_shipping_v1_service_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, - 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, - 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3f, 0x0a, 0x13, 0x56, 0x69, - 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x0a, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x52, 0x0a, 0x14, 0x56, - 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, - 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x22, - 0x47, 0x0a, 0x1b, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d, - 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, - 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x68, - 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x1c, 0x56, 0x69, 0x65, 0x77, - 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, - 0x66, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, - 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x32, 0xc4, 0x05, 0x0a, 0x0f, 0x53, 0x68, 0x69, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x0b, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x92, 0x01, 0x0a, 0x0c, 0x56, - 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, - 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, - 0x74, 0x2f, 0x7b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, - 0xb3, 0x01, 0x0a, 0x14, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, - 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x31, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, - 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x69, - 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d, - 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, - 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x6d, 0x61, 0x6e, - 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x73, 0x0a, 0x1c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, - 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, - 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, 0x1c, 0x50, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, - 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, - 0x4b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, - 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, - 0x3b, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_shipping_v1_service_proto_rawDesc = "" + + "\n" + + "\"stocklet/shipping/v1/service.proto\x12\x14stocklet.shipping.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a!stocklet/common/v1/requests.proto\x1a stocklet/events/v1/payment.proto\x1a\"stocklet/events/v1/warehouse.proto\x1a stocklet/shipping/v1/types.proto\"?\n" + + "\x13ViewShipmentRequest\x12(\n" + + "\vshipment_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "shipmentId\"R\n" + + "\x14ViewShipmentResponse\x12:\n" + + "\bshipment\x18\x01 \x01(\v2\x1e.stocklet.shipping.v1.ShipmentR\bshipment\"G\n" + + "\x1bViewShipmentManifestRequest\x12(\n" + + "\vshipment_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "shipmentId\"^\n" + + "\x1cViewShipmentManifestResponse\x12>\n" + + "\bmanifest\x18\x01 \x03(\v2\".stocklet.shipping.v1.ShipmentItemR\bmanifest2\xc4\x05\n" + + "\x0fShippingService\x12|\n" + + "\vServiceInfo\x12&.stocklet.common.v1.ServiceInfoRequest\x1a'.stocklet.common.v1.ServiceInfoResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/shipping/service\x12\x92\x01\n" + + "\fViewShipment\x12).stocklet.shipping.v1.ViewShipmentRequest\x1a*.stocklet.shipping.v1.ViewShipmentResponse\"+\x82\xd3\xe4\x93\x02%\x12#/v1/shipping/shipment/{shipment_id}\x12\xb3\x01\n" + + "\x14ViewShipmentManifest\x121.stocklet.shipping.v1.ViewShipmentManifestRequest\x1a2.stocklet.shipping.v1.ViewShipmentManifestResponse\"4\x82\xd3\xe4\x93\x02.\x12,/v1/shipping/shipment/{shipment_id}/manifest\x12s\n" + + "\x1cProcessStockReservationEvent\x12).stocklet.events.v1.StockReservationEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12s\n" + + "\x1cProcessPaymentProcessedEvent\x12).stocklet.events.v1.PaymentProcessedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNALBKZIgithub.com/hexolan/stocklet/internal/pkg/protogen/shipping/v1;shipping_v1b\x06proto3" var ( file_stocklet_shipping_v1_service_proto_rawDescOnce sync.Once - file_stocklet_shipping_v1_service_proto_rawDescData = file_stocklet_shipping_v1_service_proto_rawDesc + file_stocklet_shipping_v1_service_proto_rawDescData []byte ) func file_stocklet_shipping_v1_service_proto_rawDescGZIP() []byte { file_stocklet_shipping_v1_service_proto_rawDescOnce.Do(func() { - file_stocklet_shipping_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_shipping_v1_service_proto_rawDescData) + file_stocklet_shipping_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_shipping_v1_service_proto_rawDesc), len(file_stocklet_shipping_v1_service_proto_rawDesc))) }) return file_stocklet_shipping_v1_service_proto_rawDescData } var file_stocklet_shipping_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_stocklet_shipping_v1_service_proto_goTypes = []interface{}{ +var file_stocklet_shipping_v1_service_proto_goTypes = []any{ (*ViewShipmentRequest)(nil), // 0: stocklet.shipping.v1.ViewShipmentRequest (*ViewShipmentResponse)(nil), // 1: stocklet.shipping.v1.ViewShipmentResponse (*ViewShipmentManifestRequest)(nil), // 2: stocklet.shipping.v1.ViewShipmentManifestRequest @@ -376,61 +294,11 @@ func file_stocklet_shipping_v1_service_proto_init() { return } file_stocklet_shipping_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_stocklet_shipping_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewShipmentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_shipping_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewShipmentResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_shipping_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewShipmentManifestRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_shipping_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewShipmentManifestResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_shipping_v1_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_shipping_v1_service_proto_rawDesc), len(file_stocklet_shipping_v1_service_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -441,7 +309,6 @@ func file_stocklet_shipping_v1_service_proto_init() { MessageInfos: file_stocklet_shipping_v1_service_proto_msgTypes, }.Build() File_stocklet_shipping_v1_service_proto = out.File - file_stocklet_shipping_v1_service_proto_rawDesc = nil file_stocklet_shipping_v1_service_proto_goTypes = nil file_stocklet_shipping_v1_service_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/shipping/v1/service.pb.gw.go b/internal/pkg/protogen/shipping/v1/service.pb.gw.go index b5b198e..21367f7 100644 --- a/internal/pkg/protogen/shipping/v1/service.pb.gw.go +++ b/internal/pkg/protogen/shipping/v1/service.pb.gw.go @@ -10,6 +10,7 @@ package shipping_v1 import ( "context" + "errors" "io" "net/http" @@ -25,150 +26,128 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_ShippingService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ShippingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ShippingService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ShippingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) msg, err := server.ServiceInfo(ctx, &protoReq) return msg, metadata, err - } func request_ShippingService_ViewShipment_0(ctx context.Context, marshaler runtime.Marshaler, client ShippingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewShipmentRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewShipmentRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["shipment_id"] + val, ok := pathParams["shipment_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id") } - protoReq.ShipmentId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewShipment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ShippingService_ViewShipment_0(ctx context.Context, marshaler runtime.Marshaler, server ShippingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewShipmentRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewShipmentRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["shipment_id"] + val, ok := pathParams["shipment_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id") } - protoReq.ShipmentId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err) } - msg, err := server.ViewShipment(ctx, &protoReq) return msg, metadata, err - } func request_ShippingService_ViewShipmentManifest_0(ctx context.Context, marshaler runtime.Marshaler, client ShippingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewShipmentManifestRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewShipmentManifestRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["shipment_id"] + val, ok := pathParams["shipment_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id") } - protoReq.ShipmentId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewShipmentManifest(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ShippingService_ViewShipmentManifest_0(ctx context.Context, marshaler runtime.Marshaler, server ShippingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewShipmentManifestRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewShipmentManifestRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["shipment_id"] + val, ok := pathParams["shipment_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id") } - protoReq.ShipmentId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err) } - msg, err := server.ViewShipmentManifest(ctx, &protoReq) return msg, metadata, err - } // RegisterShippingServiceHandlerServer registers the http handlers for service ShippingService to "mux". // UnaryRPC :call ShippingServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterShippingServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterShippingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShippingServiceServer) error { - - mux.Handle("GET", pattern_ShippingService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ShippingService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/shipping/service")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/shipping/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -180,20 +159,15 @@ func RegisterShippingServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ShippingService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ShippingService_ViewShipment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ShippingService_ViewShipment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipment", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipment", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -205,20 +179,15 @@ func RegisterShippingServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ShippingService_ViewShipment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ShippingService_ViewShipmentManifest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ShippingService_ViewShipmentManifest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipmentManifest", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}/manifest")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipmentManifest", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}/manifest")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -230,9 +199,7 @@ func RegisterShippingServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ShippingService_ViewShipmentManifest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -241,25 +208,24 @@ func RegisterShippingServiceHandlerServer(ctx context.Context, mux *runtime.Serv // RegisterShippingServiceHandlerFromEndpoint is same as RegisterShippingServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterShippingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterShippingServiceHandler(ctx, mux, conn) } @@ -273,16 +239,13 @@ func RegisterShippingServiceHandler(ctx context.Context, mux *runtime.ServeMux, // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ShippingServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ShippingServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ShippingServiceClient" to call the correct interceptors. +// "ShippingServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterShippingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShippingServiceClient) error { - - mux.Handle("GET", pattern_ShippingService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ShippingService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/shipping/service")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/shipping/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -293,18 +256,13 @@ func RegisterShippingServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ShippingService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ShippingService_ViewShipment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ShippingService_ViewShipment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipment", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipment", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -315,18 +273,13 @@ func RegisterShippingServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ShippingService_ViewShipment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ShippingService_ViewShipmentManifest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ShippingService_ViewShipmentManifest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipmentManifest", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}/manifest")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipmentManifest", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}/manifest")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -337,26 +290,19 @@ func RegisterShippingServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ShippingService_ViewShipmentManifest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_ShippingService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "shipping", "service"}, "")) - - pattern_ShippingService_ViewShipment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "shipping", "shipment", "shipment_id"}, "")) - + pattern_ShippingService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "shipping", "service"}, "")) + pattern_ShippingService_ViewShipment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "shipping", "shipment", "shipment_id"}, "")) pattern_ShippingService_ViewShipmentManifest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "shipping", "shipment", "shipment_id", "manifest"}, "")) ) var ( - forward_ShippingService_ServiceInfo_0 = runtime.ForwardResponseMessage - - forward_ShippingService_ViewShipment_0 = runtime.ForwardResponseMessage - + forward_ShippingService_ServiceInfo_0 = runtime.ForwardResponseMessage + forward_ShippingService_ViewShipment_0 = runtime.ForwardResponseMessage forward_ShippingService_ViewShipmentManifest_0 = runtime.ForwardResponseMessage ) diff --git a/internal/pkg/protogen/shipping/v1/service_grpc.pb.go b/internal/pkg/protogen/shipping/v1/service_grpc.pb.go index 008f9a7..325c329 100644 --- a/internal/pkg/protogen/shipping/v1/service_grpc.pb.go +++ b/internal/pkg/protogen/shipping/v1/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: stocklet/shipping/v1/service.proto @@ -33,8 +33,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ShippingService_ServiceInfo_FullMethodName = "/stocklet.shipping.v1.ShippingService/ServiceInfo" @@ -77,8 +77,9 @@ func NewShippingServiceClient(cc grpc.ClientConnInterface) ShippingServiceClient } func (c *shippingServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v1.ServiceInfoResponse) - err := c.cc.Invoke(ctx, ShippingService_ServiceInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ShippingService_ServiceInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -86,8 +87,9 @@ func (c *shippingServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceI } func (c *shippingServiceClient) ViewShipment(ctx context.Context, in *ViewShipmentRequest, opts ...grpc.CallOption) (*ViewShipmentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewShipmentResponse) - err := c.cc.Invoke(ctx, ShippingService_ViewShipment_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ShippingService_ViewShipment_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -95,8 +97,9 @@ func (c *shippingServiceClient) ViewShipment(ctx context.Context, in *ViewShipme } func (c *shippingServiceClient) ViewShipmentManifest(ctx context.Context, in *ViewShipmentManifestRequest, opts ...grpc.CallOption) (*ViewShipmentManifestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewShipmentManifestResponse) - err := c.cc.Invoke(ctx, ShippingService_ViewShipmentManifest_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ShippingService_ViewShipmentManifest_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -104,8 +107,9 @@ func (c *shippingServiceClient) ViewShipmentManifest(ctx context.Context, in *Vi } func (c *shippingServiceClient) ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, ShippingService_ProcessStockReservationEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ShippingService_ProcessStockReservationEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -113,8 +117,9 @@ func (c *shippingServiceClient) ProcessStockReservationEvent(ctx context.Context } func (c *shippingServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, ShippingService_ProcessPaymentProcessedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ShippingService_ProcessPaymentProcessedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -123,7 +128,7 @@ func (c *shippingServiceClient) ProcessPaymentProcessedEvent(ctx context.Context // ShippingServiceServer is the server API for ShippingService service. // All implementations must embed UnimplementedShippingServiceServer -// for forward compatibility +// for forward compatibility. type ShippingServiceServer interface { // View information about the service. // @@ -146,26 +151,30 @@ type ShippingServiceServer interface { mustEmbedUnimplementedShippingServiceServer() } -// UnimplementedShippingServiceServer must be embedded to have forward compatible implementations. -type UnimplementedShippingServiceServer struct { -} +// UnimplementedShippingServiceServer 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 UnimplementedShippingServiceServer struct{} func (UnimplementedShippingServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method ServiceInfo not implemented") } func (UnimplementedShippingServiceServer) ViewShipment(context.Context, *ViewShipmentRequest) (*ViewShipmentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewShipment not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewShipment not implemented") } func (UnimplementedShippingServiceServer) ViewShipmentManifest(context.Context, *ViewShipmentManifestRequest) (*ViewShipmentManifestResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewShipmentManifest not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewShipmentManifest not implemented") } func (UnimplementedShippingServiceServer) ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessStockReservationEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessStockReservationEvent not implemented") } func (UnimplementedShippingServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented") } func (UnimplementedShippingServiceServer) mustEmbedUnimplementedShippingServiceServer() {} +func (UnimplementedShippingServiceServer) testEmbeddedByValue() {} // UnsafeShippingServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ShippingServiceServer will @@ -175,6 +184,13 @@ type UnsafeShippingServiceServer interface { } func RegisterShippingServiceServer(s grpc.ServiceRegistrar, srv ShippingServiceServer) { + // If the following call panics, it indicates UnimplementedShippingServiceServer 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(&ShippingService_ServiceDesc, srv) } diff --git a/internal/pkg/protogen/shipping/v1/types.pb.go b/internal/pkg/protogen/shipping/v1/types.pb.go index 5ae3df3..236dedc 100644 --- a/internal/pkg/protogen/shipping/v1/types.pb.go +++ b/internal/pkg/protogen/shipping/v1/types.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/shipping/v1/types.proto @@ -27,6 +27,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -37,24 +38,21 @@ const ( ) type Shipment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + Dispatched bool `protobuf:"varint,3,opt,name=dispatched,proto3" json:"dispatched,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - Dispatched bool `protobuf:"varint,3,opt,name=dispatched,proto3" json:"dispatched,omitempty"` - CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Shipment) Reset() { *x = Shipment{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_shipping_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_shipping_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Shipment) String() string { @@ -65,7 +63,7 @@ func (*Shipment) ProtoMessage() {} func (x *Shipment) ProtoReflect() protoreflect.Message { mi := &file_stocklet_shipping_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -116,22 +114,19 @@ func (x *Shipment) GetUpdatedAt() int64 { } type ShipmentItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` + ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` unknownFields protoimpl.UnknownFields - - ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` - ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ShipmentItem) Reset() { *x = ShipmentItem{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_shipping_v1_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_shipping_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ShipmentItem) String() string { @@ -142,7 +137,7 @@ func (*ShipmentItem) ProtoMessage() {} func (x *ShipmentItem) ProtoReflect() protoreflect.Message { mi := &file_stocklet_shipping_v1_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -180,54 +175,41 @@ func (x *ShipmentItem) GetQuantity() int32 { var File_stocklet_shipping_v1_types_proto protoreflect.FileDescriptor -var file_stocklet_shipping_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x14, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x08, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, - 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22, - 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, - 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x22, 0x85, 0x01, 0x0a, 0x0c, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, - 0x65, 0x6d, 0x12, 0x28, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x0a, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0a, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xba, 0x48, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, - 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x4b, 0x5a, 0x49, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x73, - 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x68, 0x69, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_shipping_v1_types_proto_rawDesc = "" + + "\n" + + " stocklet/shipping/v1/types.proto\x12\x14stocklet.shipping.v1\x1a\x1bbuf/validate/validate.proto\"\xb9\x01\n" + + "\bShipment\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\x12\"\n" + + "\border_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\aorderId\x12\x1e\n" + + "\n" + + "dispatched\x18\x03 \x01(\bR\n" + + "dispatched\x12\x1d\n" + + "\n" + + "created_at\x18\x05 \x01(\x03R\tcreatedAt\x12\"\n" + + "\n" + + "updated_at\x18\x06 \x01(\x03H\x00R\tupdatedAt\x88\x01\x01B\r\n" + + "\v_updated_at\"\x85\x01\n" + + "\fShipmentItem\x12(\n" + + "\vshipment_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "shipmentId\x12&\n" + + "\n" + + "product_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tproductId\x12#\n" + + "\bquantity\x18\x03 \x01(\x05B\a\xbaH\x04\x1a\x02 \x00R\bquantityBKZIgithub.com/hexolan/stocklet/internal/pkg/protogen/shipping/v1;shipping_v1b\x06proto3" var ( file_stocklet_shipping_v1_types_proto_rawDescOnce sync.Once - file_stocklet_shipping_v1_types_proto_rawDescData = file_stocklet_shipping_v1_types_proto_rawDesc + file_stocklet_shipping_v1_types_proto_rawDescData []byte ) func file_stocklet_shipping_v1_types_proto_rawDescGZIP() []byte { file_stocklet_shipping_v1_types_proto_rawDescOnce.Do(func() { - file_stocklet_shipping_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_shipping_v1_types_proto_rawDescData) + file_stocklet_shipping_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_shipping_v1_types_proto_rawDesc), len(file_stocklet_shipping_v1_types_proto_rawDesc))) }) return file_stocklet_shipping_v1_types_proto_rawDescData } var file_stocklet_shipping_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stocklet_shipping_v1_types_proto_goTypes = []interface{}{ +var file_stocklet_shipping_v1_types_proto_goTypes = []any{ (*Shipment)(nil), // 0: stocklet.shipping.v1.Shipment (*ShipmentItem)(nil), // 1: stocklet.shipping.v1.ShipmentItem } @@ -244,38 +226,12 @@ func file_stocklet_shipping_v1_types_proto_init() { if File_stocklet_shipping_v1_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_shipping_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Shipment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_shipping_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShipmentItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_shipping_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_stocklet_shipping_v1_types_proto_msgTypes[0].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_shipping_v1_types_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_shipping_v1_types_proto_rawDesc), len(file_stocklet_shipping_v1_types_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -286,7 +242,6 @@ func file_stocklet_shipping_v1_types_proto_init() { MessageInfos: file_stocklet_shipping_v1_types_proto_msgTypes, }.Build() File_stocklet_shipping_v1_types_proto = out.File - file_stocklet_shipping_v1_types_proto_rawDesc = nil file_stocklet_shipping_v1_types_proto_goTypes = nil file_stocklet_shipping_v1_types_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/stocklet.pb.go b/internal/pkg/protogen/stocklet.pb.go index 9df5443..d224571 100644 --- a/internal/pkg/protogen/stocklet.pb.go +++ b/internal/pkg/protogen/stocklet.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/stocklet.proto @@ -28,6 +28,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + unsafe "unsafe" ) const ( @@ -39,30 +40,14 @@ const ( var File_stocklet_stocklet_proto protoreflect.FileDescriptor -var file_stocklet_stocklet_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x73, 0x74, 0x6f, 0x63, 0x6b, - 0x6c, 0x65, 0x74, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x42, 0xd6, 0x01, 0x92, 0x41, 0x9f, 0x01, 0x12, 0x8e, 0x01, 0x0a, 0x08, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x22, 0x38, 0x0a, 0x11, 0x47, 0x69, 0x74, 0x48, 0x75, - 0x62, 0x20, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x23, 0x68, 0x74, - 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2a, 0x41, 0x0a, 0x08, 0x41, 0x47, 0x50, 0x4c, 0x2d, 0x33, 0x2e, 0x30, 0x12, 0x35, 0x68, - 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, - 0x45, 0x4e, 0x53, 0x45, 0x32, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x1a, 0x09, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x2a, 0x01, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_stocklet_proto_rawDesc = "" + + "\n" + + "\x17stocklet/stocklet.proto\x12\bstocklet\x1a.protoc-gen-openapiv2/options/annotations.protoB\xd6\x01\x92A\x9f\x01\x12\x8e\x01\n" + + "\bStocklet\"8\n" + + "\x11GitHub Repository\x12#https://github.com/hexolan/stocklet*A\n" + + "\bAGPL-3.0\x125https://github.com/hexolan/stocklet/blob/main/LICENSE2\x050.1.0\x1a\tlocalhost*\x01\x01Z1github.com/hexolan/stocklet/internal/pkg/protogenb\x06proto3" -var file_stocklet_stocklet_proto_goTypes = []interface{}{} +var file_stocklet_stocklet_proto_goTypes = []any{} var file_stocklet_stocklet_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type @@ -80,7 +65,7 @@ func file_stocklet_stocklet_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_stocklet_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_stocklet_proto_rawDesc), len(file_stocklet_stocklet_proto_rawDesc)), NumEnums: 0, NumMessages: 0, NumExtensions: 0, @@ -90,7 +75,6 @@ func file_stocklet_stocklet_proto_init() { DependencyIndexes: file_stocklet_stocklet_proto_depIdxs, }.Build() File_stocklet_stocklet_proto = out.File - file_stocklet_stocklet_proto_rawDesc = nil file_stocklet_stocklet_proto_goTypes = nil file_stocklet_stocklet_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/user/v1/service.pb.go b/internal/pkg/protogen/user/v1/service.pb.go index aa58958..3748aa4 100644 --- a/internal/pkg/protogen/user/v1/service.pb.go +++ b/internal/pkg/protogen/user/v1/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/user/v1/service.proto @@ -29,6 +29,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -39,20 +40,17 @@ const ( ) type ViewUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewUserRequest) Reset() { *x = ViewUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_user_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_user_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewUserRequest) String() string { @@ -63,7 +61,7 @@ func (*ViewUserRequest) ProtoMessage() {} func (x *ViewUserRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_user_v1_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -86,20 +84,17 @@ func (x *ViewUserRequest) GetId() string { } type ViewUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewUserResponse) Reset() { *x = ViewUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_user_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_user_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewUserResponse) String() string { @@ -110,7 +105,7 @@ func (*ViewUserResponse) ProtoMessage() {} func (x *ViewUserResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_user_v1_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -133,23 +128,20 @@ func (x *ViewUserResponse) GetUser() *User { } type RegisterUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` + LastName string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` unknownFields protoimpl.UnknownFields - - FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` - LastName string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` + sizeCache protoimpl.SizeCache } func (x *RegisterUserRequest) Reset() { *x = RegisterUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_user_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_user_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RegisterUserRequest) String() string { @@ -160,7 +152,7 @@ func (*RegisterUserRequest) ProtoMessage() {} func (x *RegisterUserRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_user_v1_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -204,20 +196,17 @@ func (x *RegisterUserRequest) GetPassword() string { } type RegisterUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + sizeCache protoimpl.SizeCache } func (x *RegisterUserResponse) Reset() { *x = RegisterUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_user_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_user_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RegisterUserResponse) String() string { @@ -228,7 +217,7 @@ func (*RegisterUserResponse) ProtoMessage() {} func (x *RegisterUserResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_user_v1_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -252,87 +241,40 @@ func (x *RegisterUserResponse) GetUser() *User { var File_stocklet_user_v1_service_proto protoreflect.FileDescriptor -var file_stocklet_user_v1_service_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, - 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x10, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, - 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, - 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x2a, 0x0a, 0x0f, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3e, 0x0a, 0x10, 0x56, - 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2a, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xb9, 0x01, 0x0a, 0x13, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, - 0x04, 0x10, 0x01, 0x18, 0x23, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x29, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, - 0x23, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xe0, 0x41, 0x02, 0xba, - 0x48, 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28, 0x0a, - 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x40, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x42, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2a, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0xf1, 0x02, 0x0a, 0x0b, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0b, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6e, 0x0a, 0x08, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x21, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, - 0x12, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x78, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x76, - 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x42, - 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, - 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_user_v1_service_proto_rawDesc = "" + + "\n" + + "\x1estocklet/user/v1/service.proto\x12\x10stocklet.user.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a!stocklet/common/v1/requests.proto\x1a\x1cstocklet/user/v1/types.proto\"*\n" + + "\x0fViewUserRequest\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\">\n" + + "\x10ViewUserResponse\x12*\n" + + "\x04user\x18\x01 \x01(\v2\x16.stocklet.user.v1.UserR\x04user\"\xbd\x01\n" + + "\x13RegisterUserRequest\x12,\n" + + "\n" + + "first_name\x18\x01 \x01(\tB\r\xe2A\x01\x02\xbaH\x06r\x04\x10\x01\x18#R\tfirstName\x12*\n" + + "\tlast_name\x18\x02 \x01(\tB\r\xe2A\x01\x02\xbaH\x06r\x04\x10\x01\x18#R\blastName\x12!\n" + + "\x05email\x18\x03 \x01(\tB\v\xe2A\x01\x02\xbaH\x04r\x02`\x01R\x05email\x12)\n" + + "\bpassword\x18\x04 \x01(\tB\r\xe2A\x01\x02\xbaH\x06r\x04\x10\x01\x18@R\bpassword\"B\n" + + "\x14RegisterUserResponse\x12*\n" + + "\x04user\x18\x01 \x01(\v2\x16.stocklet.user.v1.UserR\x04user2\xf1\x02\n" + + "\vUserService\x12x\n" + + "\vServiceInfo\x12&.stocklet.common.v1.ServiceInfoRequest\x1a'.stocklet.common.v1.ServiceInfoResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/user/service\x12n\n" + + "\bViewUser\x12!.stocklet.user.v1.ViewUserRequest\x1a\".stocklet.user.v1.ViewUserResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/user/users/{id}\x12x\n" + + "\fRegisterUser\x12%.stocklet.user.v1.RegisterUserRequest\x1a&.stocklet.user.v1.RegisterUserResponse\"\x19\x82\xd3\xe4\x93\x02\x13\"\x11/v1/user/registerBCZAgithub.com/hexolan/stocklet/internal/pkg/protogen/user/v1;user_v1b\x06proto3" var ( file_stocklet_user_v1_service_proto_rawDescOnce sync.Once - file_stocklet_user_v1_service_proto_rawDescData = file_stocklet_user_v1_service_proto_rawDesc + file_stocklet_user_v1_service_proto_rawDescData []byte ) func file_stocklet_user_v1_service_proto_rawDescGZIP() []byte { file_stocklet_user_v1_service_proto_rawDescOnce.Do(func() { - file_stocklet_user_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_user_v1_service_proto_rawDescData) + file_stocklet_user_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_user_v1_service_proto_rawDesc), len(file_stocklet_user_v1_service_proto_rawDesc))) }) return file_stocklet_user_v1_service_proto_rawDescData } var file_stocklet_user_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_stocklet_user_v1_service_proto_goTypes = []interface{}{ +var file_stocklet_user_v1_service_proto_goTypes = []any{ (*ViewUserRequest)(nil), // 0: stocklet.user.v1.ViewUserRequest (*ViewUserResponse)(nil), // 1: stocklet.user.v1.ViewUserResponse (*RegisterUserRequest)(nil), // 2: stocklet.user.v1.RegisterUserRequest @@ -363,61 +305,11 @@ func file_stocklet_user_v1_service_proto_init() { return } file_stocklet_user_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_stocklet_user_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_user_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_user_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_user_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_user_v1_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_user_v1_service_proto_rawDesc), len(file_stocklet_user_v1_service_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -428,7 +320,6 @@ func file_stocklet_user_v1_service_proto_init() { MessageInfos: file_stocklet_user_v1_service_proto_msgTypes, }.Build() File_stocklet_user_v1_service_proto = out.File - file_stocklet_user_v1_service_proto_rawDesc = nil file_stocklet_user_v1_service_proto_goTypes = nil file_stocklet_user_v1_service_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/user/v1/service.pb.gw.go b/internal/pkg/protogen/user/v1/service.pb.gw.go index 6f7c25f..603d22d 100644 --- a/internal/pkg/protogen/user/v1/service.pb.gw.go +++ b/internal/pkg/protogen/user/v1/service.pb.gw.go @@ -10,6 +10,7 @@ package user_v1 import ( "context" + "errors" "io" "net/http" @@ -25,134 +26,124 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_UserService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_UserService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) msg, err := server.ServiceInfo(ctx, &protoReq) return msg, metadata, err - } func request_UserService_ViewUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewUserRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewUserRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_UserService_ViewUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewUserRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewUserRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.ViewUser(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_UserService_RegisterUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_UserService_RegisterUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_UserService_RegisterUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterUserRequest - var metadata runtime.ServerMetadata - + var ( + protoReq RegisterUserRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_RegisterUser_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.RegisterUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_UserService_RegisterUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterUserRequest - var metadata runtime.ServerMetadata - + var ( + protoReq RegisterUserRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_RegisterUser_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.RegisterUser(ctx, &protoReq) return msg, metadata, err - } // RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". // UnaryRPC :call UserServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error { - - mux.Handle("GET", pattern_UserService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_UserService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/user/service")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/user/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -164,20 +155,15 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_UserService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_UserService_ViewUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_UserService_ViewUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/ViewUser", runtime.WithHTTPPathPattern("/v1/user/users/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/ViewUser", runtime.WithHTTPPathPattern("/v1/user/users/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -189,20 +175,15 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_UserService_ViewUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_UserService_RegisterUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_UserService_RegisterUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/RegisterUser", runtime.WithHTTPPathPattern("/v1/user/register")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/RegisterUser", runtime.WithHTTPPathPattern("/v1/user/register")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -214,9 +195,7 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_UserService_RegisterUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -225,25 +204,24 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux // RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterUserServiceHandler(ctx, mux, conn) } @@ -257,16 +235,13 @@ func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "UserServiceClient" to call the correct interceptors. +// "UserServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error { - - mux.Handle("GET", pattern_UserService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_UserService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/user/service")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/user/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -277,18 +252,13 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_UserService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_UserService_ViewUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_UserService_ViewUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/ViewUser", runtime.WithHTTPPathPattern("/v1/user/users/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/ViewUser", runtime.WithHTTPPathPattern("/v1/user/users/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -299,18 +269,13 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_UserService_ViewUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_UserService_RegisterUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_UserService_RegisterUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/RegisterUser", runtime.WithHTTPPathPattern("/v1/user/register")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/RegisterUser", runtime.WithHTTPPathPattern("/v1/user/register")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -321,26 +286,19 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_UserService_RegisterUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_UserService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "user", "service"}, "")) - - pattern_UserService_ViewUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "user", "users", "id"}, "")) - + pattern_UserService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "user", "service"}, "")) + pattern_UserService_ViewUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "user", "users", "id"}, "")) pattern_UserService_RegisterUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "user", "register"}, "")) ) var ( - forward_UserService_ServiceInfo_0 = runtime.ForwardResponseMessage - - forward_UserService_ViewUser_0 = runtime.ForwardResponseMessage - + forward_UserService_ServiceInfo_0 = runtime.ForwardResponseMessage + forward_UserService_ViewUser_0 = runtime.ForwardResponseMessage forward_UserService_RegisterUser_0 = runtime.ForwardResponseMessage ) diff --git a/internal/pkg/protogen/user/v1/service_grpc.pb.go b/internal/pkg/protogen/user/v1/service_grpc.pb.go index 018b21a..431f19d 100644 --- a/internal/pkg/protogen/user/v1/service_grpc.pb.go +++ b/internal/pkg/protogen/user/v1/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: stocklet/user/v1/service.proto @@ -31,8 +31,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( UserService_ServiceInfo_FullMethodName = "/stocklet.user.v1.UserService/ServiceInfo" @@ -61,8 +61,9 @@ func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { } func (c *userServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v1.ServiceInfoResponse) - err := c.cc.Invoke(ctx, UserService_ServiceInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, UserService_ServiceInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -70,8 +71,9 @@ func (c *userServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoR } func (c *userServiceClient) ViewUser(ctx context.Context, in *ViewUserRequest, opts ...grpc.CallOption) (*ViewUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewUserResponse) - err := c.cc.Invoke(ctx, UserService_ViewUser_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, UserService_ViewUser_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -79,8 +81,9 @@ func (c *userServiceClient) ViewUser(ctx context.Context, in *ViewUserRequest, o } func (c *userServiceClient) RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RegisterUserResponse) - err := c.cc.Invoke(ctx, UserService_RegisterUser_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, UserService_RegisterUser_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -89,7 +92,7 @@ func (c *userServiceClient) RegisterUser(ctx context.Context, in *RegisterUserRe // UserServiceServer is the server API for UserService service. // All implementations must embed UnimplementedUserServiceServer -// for forward compatibility +// for forward compatibility. type UserServiceServer interface { // View information about the service. // @@ -100,20 +103,24 @@ type UserServiceServer interface { mustEmbedUnimplementedUserServiceServer() } -// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. -type UnimplementedUserServiceServer struct { -} +// UnimplementedUserServiceServer 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 UnimplementedUserServiceServer struct{} func (UnimplementedUserServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method ServiceInfo not implemented") } func (UnimplementedUserServiceServer) ViewUser(context.Context, *ViewUserRequest) (*ViewUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewUser not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewUser not implemented") } func (UnimplementedUserServiceServer) RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterUser not implemented") + return nil, status.Error(codes.Unimplemented, "method RegisterUser not implemented") } func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} +func (UnimplementedUserServiceServer) testEmbeddedByValue() {} // UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UserServiceServer will @@ -123,6 +130,13 @@ type UnsafeUserServiceServer interface { } func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + // If the following call panics, it indicates UnimplementedUserServiceServer 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(&UserService_ServiceDesc, srv) } diff --git a/internal/pkg/protogen/user/v1/types.pb.go b/internal/pkg/protogen/user/v1/types.pb.go index 9c345e4..5e2d161 100644 --- a/internal/pkg/protogen/user/v1/types.pb.go +++ b/internal/pkg/protogen/user/v1/types.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/user/v1/types.proto @@ -27,6 +27,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -37,25 +38,22 @@ const ( ) type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` + LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` - LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` - CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` + sizeCache protoimpl.SizeCache } func (x *User) Reset() { *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_user_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_user_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *User) String() string { @@ -66,7 +64,7 @@ func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { mi := &file_stocklet_user_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -125,47 +123,35 @@ func (x *User) GetUpdatedAt() int64 { var File_stocklet_user_v1_types_proto protoreflect.FileDescriptor -var file_stocklet_user_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x01, - 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1d, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xba, 0x48, 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28, - 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x09, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x23, 0x52, 0x09, 0x66, - 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xba, 0x48, 0x06, - 0x72, 0x04, 0x10, 0x01, 0x18, 0x23, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x22, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, - 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_user_v1_types_proto_rawDesc = "" + + "\n" + + "\x1cstocklet/user/v1/types.proto\x12\x10stocklet.user.v1\x1a\x1bbuf/validate/validate.proto\"\xe2\x01\n" + + "\x04User\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\x12\x1d\n" + + "\x05email\x18\x02 \x01(\tB\a\xbaH\x04r\x02`\x01R\x05email\x12(\n" + + "\n" + + "first_name\x18\x03 \x01(\tB\t\xbaH\x06r\x04\x10\x01\x18#R\tfirstName\x12&\n" + + "\tlast_name\x18\x04 \x01(\tB\t\xbaH\x06r\x04\x10\x01\x18#R\blastName\x12\x1d\n" + + "\n" + + "created_at\x18\x05 \x01(\x03R\tcreatedAt\x12\"\n" + + "\n" + + "updated_at\x18\x06 \x01(\x03H\x00R\tupdatedAt\x88\x01\x01B\r\n" + + "\v_updated_atBCZAgithub.com/hexolan/stocklet/internal/pkg/protogen/user/v1;user_v1b\x06proto3" var ( file_stocklet_user_v1_types_proto_rawDescOnce sync.Once - file_stocklet_user_v1_types_proto_rawDescData = file_stocklet_user_v1_types_proto_rawDesc + file_stocklet_user_v1_types_proto_rawDescData []byte ) func file_stocklet_user_v1_types_proto_rawDescGZIP() []byte { file_stocklet_user_v1_types_proto_rawDescOnce.Do(func() { - file_stocklet_user_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_user_v1_types_proto_rawDescData) + file_stocklet_user_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_user_v1_types_proto_rawDesc), len(file_stocklet_user_v1_types_proto_rawDesc))) }) return file_stocklet_user_v1_types_proto_rawDescData } var file_stocklet_user_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_stocklet_user_v1_types_proto_goTypes = []interface{}{ +var file_stocklet_user_v1_types_proto_goTypes = []any{ (*User)(nil), // 0: stocklet.user.v1.User } var file_stocklet_user_v1_types_proto_depIdxs = []int32{ @@ -181,26 +167,12 @@ func file_stocklet_user_v1_types_proto_init() { if File_stocklet_user_v1_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_user_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_stocklet_user_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_stocklet_user_v1_types_proto_msgTypes[0].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_user_v1_types_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_user_v1_types_proto_rawDesc), len(file_stocklet_user_v1_types_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -211,7 +183,6 @@ func file_stocklet_user_v1_types_proto_init() { MessageInfos: file_stocklet_user_v1_types_proto_msgTypes, }.Build() File_stocklet_user_v1_types_proto = out.File - file_stocklet_user_v1_types_proto_rawDesc = nil file_stocklet_user_v1_types_proto_goTypes = nil file_stocklet_user_v1_types_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/warehouse/v1/service.pb.go b/internal/pkg/protogen/warehouse/v1/service.pb.go index c1601fa..71efa9a 100644 --- a/internal/pkg/protogen/warehouse/v1/service.pb.go +++ b/internal/pkg/protogen/warehouse/v1/service.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/warehouse/v1/service.proto @@ -32,6 +32,7 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -42,20 +43,17 @@ const ( ) type ViewProductStockRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewProductStockRequest) Reset() { *x = ViewProductStockRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewProductStockRequest) String() string { @@ -66,7 +64,7 @@ func (*ViewProductStockRequest) ProtoMessage() {} func (x *ViewProductStockRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -89,20 +87,17 @@ func (x *ViewProductStockRequest) GetProductId() string { } type ViewProductStockResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Stock *ProductStock `protobuf:"bytes,1,opt,name=stock,proto3" json:"stock,omitempty"` unknownFields protoimpl.UnknownFields - - Stock *ProductStock `protobuf:"bytes,1,opt,name=stock,proto3" json:"stock,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewProductStockResponse) Reset() { *x = ViewProductStockResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewProductStockResponse) String() string { @@ -113,7 +108,7 @@ func (*ViewProductStockResponse) ProtoMessage() {} func (x *ViewProductStockResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -136,20 +131,17 @@ func (x *ViewProductStockResponse) GetStock() *ProductStock { } type ViewReservationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ReservationId string `protobuf:"bytes,1,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` unknownFields protoimpl.UnknownFields - - ReservationId string `protobuf:"bytes,1,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewReservationRequest) Reset() { *x = ViewReservationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewReservationRequest) String() string { @@ -160,7 +152,7 @@ func (*ViewReservationRequest) ProtoMessage() {} func (x *ViewReservationRequest) ProtoReflect() protoreflect.Message { mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,20 +175,17 @@ func (x *ViewReservationRequest) GetReservationId() string { } type ViewReservationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Reservation *Reservation `protobuf:"bytes,1,opt,name=reservation,proto3" json:"reservation,omitempty"` unknownFields protoimpl.UnknownFields - - Reservation *Reservation `protobuf:"bytes,1,opt,name=reservation,proto3" json:"reservation,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ViewReservationResponse) Reset() { *x = ViewReservationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ViewReservationResponse) String() string { @@ -207,7 +196,7 @@ func (*ViewReservationResponse) ProtoMessage() {} func (x *ViewReservationResponse) ProtoReflect() protoreflect.Message { mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -231,132 +220,45 @@ func (x *ViewReservationResponse) GetReservation() *Reservation { var File_stocklet_warehouse_v1_service_proto protoreflect.FileDescriptor -var file_stocklet_warehouse_v1_service_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, - 0x6f, 0x75, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, - 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, - 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, - 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, - 0x0a, 0x17, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x74, 0x6f, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, - 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, - 0x64, 0x22, 0x55, 0x0a, 0x18, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, - 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x63, - 0x6b, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x22, 0x48, 0x0a, 0x16, 0x56, 0x69, 0x65, 0x77, - 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x17, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, - 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, - 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x32, 0xa6, 0x07, 0x0a, 0x10, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x10, 0x56, 0x69, 0x65, 0x77, - 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x2e, 0x2e, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, - 0x6f, 0x75, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa4, 0x01, 0x0a, 0x0f, 0x56, 0x69, - 0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x73, - 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, - 0x75, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, - 0x7b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, - 0x12, 0x6f, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x27, - 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, - 0x4c, 0x12, 0x6b, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x2e, - 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, - 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x77, - 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, - 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, - 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, 0x1c, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, - 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, - 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, 0x4d, 0x5a, 0x4b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, - 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, - 0x6e, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x77, - 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_stocklet_warehouse_v1_service_proto_rawDesc = "" + + "\n" + + "#stocklet/warehouse/v1/service.proto\x12\x15stocklet.warehouse.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a!stocklet/common/v1/requests.proto\x1a\x1estocklet/events/v1/order.proto\x1a stocklet/events/v1/payment.proto\x1a stocklet/events/v1/product.proto\x1a!stocklet/events/v1/shipping.proto\x1a!stocklet/warehouse/v1/types.proto\"A\n" + + "\x17ViewProductStockRequest\x12&\n" + + "\n" + + "product_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tproductId\"U\n" + + "\x18ViewProductStockResponse\x129\n" + + "\x05stock\x18\x01 \x01(\v2#.stocklet.warehouse.v1.ProductStockR\x05stock\"H\n" + + "\x16ViewReservationRequest\x12.\n" + + "\x0ereservation_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\rreservationId\"_\n" + + "\x17ViewReservationResponse\x12D\n" + + "\vreservation\x18\x01 \x01(\v2\".stocklet.warehouse.v1.ReservationR\vreservation2\xa6\a\n" + + "\x10WarehouseService\x12}\n" + + "\vServiceInfo\x12&.stocklet.common.v1.ServiceInfoRequest\x1a'.stocklet.common.v1.ServiceInfoResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/warehouse/service\x12\x9f\x01\n" + + "\x10ViewProductStock\x12..stocklet.warehouse.v1.ViewProductStockRequest\x1a/.stocklet.warehouse.v1.ViewProductStockResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v1/warehouse/product/{product_id}\x12\xa4\x01\n" + + "\x0fViewReservation\x12-.stocklet.warehouse.v1.ViewReservationRequest\x1a..stocklet.warehouse.v1.ViewReservationResponse\"2\x82\xd3\xe4\x93\x02,\x12*/v1/warehouse/reservation/{reservation_id}\x12o\n" + + "\x1aProcessProductCreatedEvent\x12'.stocklet.events.v1.ProductCreatedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12k\n" + + "\x18ProcessOrderPendingEvent\x12%.stocklet.events.v1.OrderPendingEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12w\n" + + "\x1eProcessShipmentAllocationEvent\x12+.stocklet.events.v1.ShipmentAllocationEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNAL\x12s\n" + + "\x1cProcessPaymentProcessedEvent\x12).stocklet.events.v1.PaymentProcessedEvent\x1a\x16.google.protobuf.Empty\"\x10\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNALBMZKgithub.com/hexolan/stocklet/internal/pkg/protogen/warehouse/v1;warehouse_v1b\x06proto3" var ( file_stocklet_warehouse_v1_service_proto_rawDescOnce sync.Once - file_stocklet_warehouse_v1_service_proto_rawDescData = file_stocklet_warehouse_v1_service_proto_rawDesc + file_stocklet_warehouse_v1_service_proto_rawDescData []byte ) func file_stocklet_warehouse_v1_service_proto_rawDescGZIP() []byte { file_stocklet_warehouse_v1_service_proto_rawDescOnce.Do(func() { - file_stocklet_warehouse_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_warehouse_v1_service_proto_rawDescData) + file_stocklet_warehouse_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_warehouse_v1_service_proto_rawDesc), len(file_stocklet_warehouse_v1_service_proto_rawDesc))) }) return file_stocklet_warehouse_v1_service_proto_rawDescData } var file_stocklet_warehouse_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_stocklet_warehouse_v1_service_proto_goTypes = []interface{}{ +var file_stocklet_warehouse_v1_service_proto_goTypes = []any{ (*ViewProductStockRequest)(nil), // 0: stocklet.warehouse.v1.ViewProductStockRequest (*ViewProductStockResponse)(nil), // 1: stocklet.warehouse.v1.ViewProductStockResponse (*ViewReservationRequest)(nil), // 2: stocklet.warehouse.v1.ViewReservationRequest @@ -401,61 +303,11 @@ func file_stocklet_warehouse_v1_service_proto_init() { return } file_stocklet_warehouse_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_stocklet_warehouse_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewProductStockRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_warehouse_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewProductStockResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_warehouse_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewReservationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_warehouse_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ViewReservationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_warehouse_v1_service_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_warehouse_v1_service_proto_rawDesc), len(file_stocklet_warehouse_v1_service_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -466,7 +318,6 @@ func file_stocklet_warehouse_v1_service_proto_init() { MessageInfos: file_stocklet_warehouse_v1_service_proto_msgTypes, }.Build() File_stocklet_warehouse_v1_service_proto = out.File - file_stocklet_warehouse_v1_service_proto_rawDesc = nil file_stocklet_warehouse_v1_service_proto_goTypes = nil file_stocklet_warehouse_v1_service_proto_depIdxs = nil } diff --git a/internal/pkg/protogen/warehouse/v1/service.pb.gw.go b/internal/pkg/protogen/warehouse/v1/service.pb.gw.go index 14757c5..f56981e 100644 --- a/internal/pkg/protogen/warehouse/v1/service.pb.gw.go +++ b/internal/pkg/protogen/warehouse/v1/service.pb.gw.go @@ -10,6 +10,7 @@ package warehouse_v1 import ( "context" + "errors" "io" "net/http" @@ -25,150 +26,128 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_WarehouseService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client WarehouseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_WarehouseService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server WarehouseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq common_v1.ServiceInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq common_v1.ServiceInfoRequest + metadata runtime.ServerMetadata + ) msg, err := server.ServiceInfo(ctx, &protoReq) return msg, metadata, err - } func request_WarehouseService_ViewProductStock_0(ctx context.Context, marshaler runtime.Marshaler, client WarehouseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewProductStockRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewProductStockRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["product_id"] + val, ok := pathParams["product_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "product_id") } - protoReq.ProductId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "product_id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewProductStock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_WarehouseService_ViewProductStock_0(ctx context.Context, marshaler runtime.Marshaler, server WarehouseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewProductStockRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewProductStockRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["product_id"] + val, ok := pathParams["product_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "product_id") } - protoReq.ProductId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "product_id", err) } - msg, err := server.ViewProductStock(ctx, &protoReq) return msg, metadata, err - } func request_WarehouseService_ViewReservation_0(ctx context.Context, marshaler runtime.Marshaler, client WarehouseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewReservationRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewReservationRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["reservation_id"] + val, ok := pathParams["reservation_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reservation_id") } - protoReq.ReservationId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "reservation_id", err) } - + if req.Body != nil { + _, _ = io.Copy(io.Discard, req.Body) + } msg, err := client.ViewReservation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_WarehouseService_ViewReservation_0(ctx context.Context, marshaler runtime.Marshaler, server WarehouseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ViewReservationRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ViewReservationRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["reservation_id"] + val, ok := pathParams["reservation_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reservation_id") } - protoReq.ReservationId, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "reservation_id", err) } - msg, err := server.ViewReservation(ctx, &protoReq) return msg, metadata, err - } // RegisterWarehouseServiceHandlerServer registers the http handlers for service WarehouseService to "mux". // UnaryRPC :call WarehouseServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWarehouseServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WarehouseServiceServer) error { - - mux.Handle("GET", pattern_WarehouseService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_WarehouseService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/warehouse/service")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/warehouse/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -180,20 +159,15 @@ func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_WarehouseService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_WarehouseService_ViewProductStock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_WarehouseService_ViewProductStock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewProductStock", runtime.WithHTTPPathPattern("/v1/warehouse/product/{product_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewProductStock", runtime.WithHTTPPathPattern("/v1/warehouse/product/{product_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -205,20 +179,15 @@ func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_WarehouseService_ViewProductStock_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_WarehouseService_ViewReservation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_WarehouseService_ViewReservation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewReservation", runtime.WithHTTPPathPattern("/v1/warehouse/reservation/{reservation_id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewReservation", runtime.WithHTTPPathPattern("/v1/warehouse/reservation/{reservation_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -230,9 +199,7 @@ func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_WarehouseService_ViewReservation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -241,25 +208,24 @@ func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.Ser // RegisterWarehouseServiceHandlerFromEndpoint is same as RegisterWarehouseServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterWarehouseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterWarehouseServiceHandler(ctx, mux, conn) } @@ -273,16 +239,13 @@ func RegisterWarehouseServiceHandler(ctx context.Context, mux *runtime.ServeMux, // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WarehouseServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WarehouseServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "WarehouseServiceClient" to call the correct interceptors. +// "WarehouseServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterWarehouseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WarehouseServiceClient) error { - - mux.Handle("GET", pattern_WarehouseService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_WarehouseService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/warehouse/service")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/warehouse/service")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -293,18 +256,13 @@ func RegisterWarehouseServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_WarehouseService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_WarehouseService_ViewProductStock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_WarehouseService_ViewProductStock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewProductStock", runtime.WithHTTPPathPattern("/v1/warehouse/product/{product_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewProductStock", runtime.WithHTTPPathPattern("/v1/warehouse/product/{product_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -315,18 +273,13 @@ func RegisterWarehouseServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_WarehouseService_ViewProductStock_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_WarehouseService_ViewReservation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_WarehouseService_ViewReservation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewReservation", runtime.WithHTTPPathPattern("/v1/warehouse/reservation/{reservation_id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewReservation", runtime.WithHTTPPathPattern("/v1/warehouse/reservation/{reservation_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -337,26 +290,19 @@ func RegisterWarehouseServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_WarehouseService_ViewReservation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_WarehouseService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "warehouse", "service"}, "")) - + pattern_WarehouseService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "warehouse", "service"}, "")) pattern_WarehouseService_ViewProductStock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "warehouse", "product", "product_id"}, "")) - - pattern_WarehouseService_ViewReservation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "warehouse", "reservation", "reservation_id"}, "")) + pattern_WarehouseService_ViewReservation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "warehouse", "reservation", "reservation_id"}, "")) ) var ( - forward_WarehouseService_ServiceInfo_0 = runtime.ForwardResponseMessage - + forward_WarehouseService_ServiceInfo_0 = runtime.ForwardResponseMessage forward_WarehouseService_ViewProductStock_0 = runtime.ForwardResponseMessage - - forward_WarehouseService_ViewReservation_0 = runtime.ForwardResponseMessage + forward_WarehouseService_ViewReservation_0 = runtime.ForwardResponseMessage ) diff --git a/internal/pkg/protogen/warehouse/v1/service_grpc.pb.go b/internal/pkg/protogen/warehouse/v1/service_grpc.pb.go index cdbd80d..38aabc4 100644 --- a/internal/pkg/protogen/warehouse/v1/service_grpc.pb.go +++ b/internal/pkg/protogen/warehouse/v1/service_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) // source: stocklet/warehouse/v1/service.proto @@ -33,8 +33,8 @@ import ( // 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.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( WarehouseService_ServiceInfo_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ServiceInfo" @@ -91,8 +91,9 @@ func NewWarehouseServiceClient(cc grpc.ClientConnInterface) WarehouseServiceClie } func (c *warehouseServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(v1.ServiceInfoResponse) - err := c.cc.Invoke(ctx, WarehouseService_ServiceInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WarehouseService_ServiceInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -100,8 +101,9 @@ func (c *warehouseServiceClient) ServiceInfo(ctx context.Context, in *v1.Service } func (c *warehouseServiceClient) ViewProductStock(ctx context.Context, in *ViewProductStockRequest, opts ...grpc.CallOption) (*ViewProductStockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewProductStockResponse) - err := c.cc.Invoke(ctx, WarehouseService_ViewProductStock_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WarehouseService_ViewProductStock_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -109,8 +111,9 @@ func (c *warehouseServiceClient) ViewProductStock(ctx context.Context, in *ViewP } func (c *warehouseServiceClient) ViewReservation(ctx context.Context, in *ViewReservationRequest, opts ...grpc.CallOption) (*ViewReservationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ViewReservationResponse) - err := c.cc.Invoke(ctx, WarehouseService_ViewReservation_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WarehouseService_ViewReservation_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -118,8 +121,9 @@ func (c *warehouseServiceClient) ViewReservation(ctx context.Context, in *ViewRe } func (c *warehouseServiceClient) ProcessProductCreatedEvent(ctx context.Context, in *v11.ProductCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, WarehouseService_ProcessProductCreatedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WarehouseService_ProcessProductCreatedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -127,8 +131,9 @@ func (c *warehouseServiceClient) ProcessProductCreatedEvent(ctx context.Context, } func (c *warehouseServiceClient) ProcessOrderPendingEvent(ctx context.Context, in *v11.OrderPendingEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, WarehouseService_ProcessOrderPendingEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WarehouseService_ProcessOrderPendingEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -136,8 +141,9 @@ func (c *warehouseServiceClient) ProcessOrderPendingEvent(ctx context.Context, i } func (c *warehouseServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, WarehouseService_ProcessShipmentAllocationEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WarehouseService_ProcessShipmentAllocationEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -145,8 +151,9 @@ func (c *warehouseServiceClient) ProcessShipmentAllocationEvent(ctx context.Cont } func (c *warehouseServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, WarehouseService_ProcessPaymentProcessedEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WarehouseService_ProcessPaymentProcessedEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -155,7 +162,7 @@ func (c *warehouseServiceClient) ProcessPaymentProcessedEvent(ctx context.Contex // WarehouseServiceServer is the server API for WarehouseService service. // All implementations must embed UnimplementedWarehouseServiceServer -// for forward compatibility +// for forward compatibility. type WarehouseServiceServer interface { // View information about the service. // @@ -190,32 +197,36 @@ type WarehouseServiceServer interface { mustEmbedUnimplementedWarehouseServiceServer() } -// UnimplementedWarehouseServiceServer must be embedded to have forward compatible implementations. -type UnimplementedWarehouseServiceServer struct { -} +// UnimplementedWarehouseServiceServer 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 UnimplementedWarehouseServiceServer struct{} func (UnimplementedWarehouseServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method ServiceInfo not implemented") } func (UnimplementedWarehouseServiceServer) ViewProductStock(context.Context, *ViewProductStockRequest) (*ViewProductStockResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewProductStock not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewProductStock not implemented") } func (UnimplementedWarehouseServiceServer) ViewReservation(context.Context, *ViewReservationRequest) (*ViewReservationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ViewReservation not implemented") + return nil, status.Error(codes.Unimplemented, "method ViewReservation not implemented") } func (UnimplementedWarehouseServiceServer) ProcessProductCreatedEvent(context.Context, *v11.ProductCreatedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessProductCreatedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessProductCreatedEvent not implemented") } func (UnimplementedWarehouseServiceServer) ProcessOrderPendingEvent(context.Context, *v11.OrderPendingEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessOrderPendingEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessOrderPendingEvent not implemented") } func (UnimplementedWarehouseServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented") } func (UnimplementedWarehouseServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented") + return nil, status.Error(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented") } func (UnimplementedWarehouseServiceServer) mustEmbedUnimplementedWarehouseServiceServer() {} +func (UnimplementedWarehouseServiceServer) testEmbeddedByValue() {} // UnsafeWarehouseServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to WarehouseServiceServer will @@ -225,6 +236,13 @@ type UnsafeWarehouseServiceServer interface { } func RegisterWarehouseServiceServer(s grpc.ServiceRegistrar, srv WarehouseServiceServer) { + // If the following call panics, it indicates UnimplementedWarehouseServiceServer 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(&WarehouseService_ServiceDesc, srv) } diff --git a/internal/pkg/protogen/warehouse/v1/types.pb.go b/internal/pkg/protogen/warehouse/v1/types.pb.go index 4670f32..c62aa97 100644 --- a/internal/pkg/protogen/warehouse/v1/types.pb.go +++ b/internal/pkg/protogen/warehouse/v1/types.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: stocklet/warehouse/v1/types.proto @@ -27,6 +27,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -37,21 +38,18 @@ const ( ) type ProductStock struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ProductStock) Reset() { *x = ProductStock{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProductStock) String() string { @@ -62,7 +60,7 @@ func (*ProductStock) ProtoMessage() {} func (x *ProductStock) ProtoReflect() protoreflect.Message { mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -92,23 +90,20 @@ func (x *ProductStock) GetQuantity() int32 { } type Reservation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + ReservedStock []*ReservationStock `protobuf:"bytes,3,rep,name=reserved_stock,json=reservedStock,proto3" json:"reserved_stock,omitempty"` + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` - ReservedStock []*ReservationStock `protobuf:"bytes,3,rep,name=reserved_stock,json=reservedStock,proto3" json:"reserved_stock,omitempty"` - CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Reservation) Reset() { *x = Reservation{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reservation) String() string { @@ -119,7 +114,7 @@ func (*Reservation) ProtoMessage() {} func (x *Reservation) ProtoReflect() protoreflect.Message { mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -163,21 +158,18 @@ func (x *Reservation) GetCreatedAt() int64 { } type ReservationStock struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` unknownFields protoimpl.UnknownFields - - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` - Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ReservationStock) Reset() { *x = ReservationStock{} - if protoimpl.UnsafeEnabled { - mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ReservationStock) String() string { @@ -188,7 +180,7 @@ func (*ReservationStock) ProtoMessage() {} func (x *ReservationStock) ProtoReflect() protoreflect.Message { mi := &file_stocklet_warehouse_v1_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -219,58 +211,38 @@ func (x *ReservationStock) GetQuantity() int32 { var File_stocklet_warehouse_v1_types_proto protoreflect.FileDescriptor -var file_stocklet_warehouse_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, - 0x6f, 0x75, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, - 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, - 0x23, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x07, 0xba, 0x48, 0x04, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x22, 0xb9, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, - 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x4e, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x73, 0x74, - 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, - 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, - 0x63, 0x6b, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x63, - 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x22, 0x5f, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x08, - 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, - 0xba, 0x48, 0x04, 0x1a, 0x02, 0x28, 0x00, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x42, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, - 0x2f, 0x76, 0x31, 0x3b, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_stocklet_warehouse_v1_types_proto_rawDesc = "" + + "\n" + + "!stocklet/warehouse/v1/types.proto\x12\x15stocklet.warehouse.v1\x1a\x1bbuf/validate/validate.proto\"[\n" + + "\fProductStock\x12&\n" + + "\n" + + "product_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tproductId\x12#\n" + + "\bquantity\x18\x02 \x01(\x05B\a\xbaH\x04\x1a\x02(\x00R\bquantity\"\xb9\x01\n" + + "\vReservation\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\x12\"\n" + + "\border_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\aorderId\x12N\n" + + "\x0ereserved_stock\x18\x03 \x03(\v2'.stocklet.warehouse.v1.ReservationStockR\rreservedStock\x12\x1d\n" + + "\n" + + "created_at\x18\x04 \x01(\x03R\tcreatedAt\"_\n" + + "\x10ReservationStock\x12&\n" + + "\n" + + "product_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tproductId\x12#\n" + + "\bquantity\x18\x02 \x01(\x05B\a\xbaH\x04\x1a\x02(\x00R\bquantityBMZKgithub.com/hexolan/stocklet/internal/pkg/protogen/warehouse/v1;warehouse_v1b\x06proto3" var ( file_stocklet_warehouse_v1_types_proto_rawDescOnce sync.Once - file_stocklet_warehouse_v1_types_proto_rawDescData = file_stocklet_warehouse_v1_types_proto_rawDesc + file_stocklet_warehouse_v1_types_proto_rawDescData []byte ) func file_stocklet_warehouse_v1_types_proto_rawDescGZIP() []byte { file_stocklet_warehouse_v1_types_proto_rawDescOnce.Do(func() { - file_stocklet_warehouse_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_warehouse_v1_types_proto_rawDescData) + file_stocklet_warehouse_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_warehouse_v1_types_proto_rawDesc), len(file_stocklet_warehouse_v1_types_proto_rawDesc))) }) return file_stocklet_warehouse_v1_types_proto_rawDescData } var file_stocklet_warehouse_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_stocklet_warehouse_v1_types_proto_goTypes = []interface{}{ +var file_stocklet_warehouse_v1_types_proto_goTypes = []any{ (*ProductStock)(nil), // 0: stocklet.warehouse.v1.ProductStock (*Reservation)(nil), // 1: stocklet.warehouse.v1.Reservation (*ReservationStock)(nil), // 2: stocklet.warehouse.v1.ReservationStock @@ -289,49 +261,11 @@ func file_stocklet_warehouse_v1_types_proto_init() { if File_stocklet_warehouse_v1_types_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stocklet_warehouse_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductStock); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_warehouse_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Reservation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stocklet_warehouse_v1_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReservationStock); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stocklet_warehouse_v1_types_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_warehouse_v1_types_proto_rawDesc), len(file_stocklet_warehouse_v1_types_proto_rawDesc)), NumEnums: 0, NumMessages: 3, NumExtensions: 0, @@ -342,7 +276,6 @@ func file_stocklet_warehouse_v1_types_proto_init() { MessageInfos: file_stocklet_warehouse_v1_types_proto_msgTypes, }.Build() File_stocklet_warehouse_v1_types_proto = out.File - file_stocklet_warehouse_v1_types_proto_rawDesc = nil file_stocklet_warehouse_v1_types_proto_goTypes = nil file_stocklet_warehouse_v1_types_proto_depIdxs = nil } diff --git a/schema/openapi/services.swagger.yaml b/schema/openapi/services.swagger.yaml index 951b4bd..2e53404 100644 --- a/schema/openapi/services.swagger.yaml +++ b/schema/openapi/services.swagger.yaml @@ -461,7 +461,7 @@ definitions: properties: '@type': type: string - additionalProperties: {} + additionalProperties: true rpcStatus: type: object properties: @@ -553,7 +553,7 @@ definitions: - ORDER_STATUS_APPROVED - ORDER_STATUS_COMPLETED default: ORDER_STATUS_UNSPECIFIED - title: |- + description: |- - ORDER_STATUS_PROCESSING: awaiting price quotes for products - ORDER_STATUS_PENDING: awaiting stock allocation, shipping allotment and payment v1PlaceOrderResponse: