mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 04:00:27 +00:00
update readmessages via grpc (#316)
Signed-off-by: musilah <nataleigh.nk@gmail.com>
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc v6.30.2
|
||||
// protoc-gen-go v1.36.9
|
||||
// protoc v3.21.12
|
||||
// source: readers/v1/readers.proto
|
||||
|
||||
package v1
|
||||
@@ -102,6 +102,8 @@ type PageMetadata struct {
|
||||
Aggregation Aggregation `protobuf:"varint,15,opt,name=aggregation,proto3,enum=readers.v1.Aggregation" json:"aggregation,omitempty"`
|
||||
Comparator string `protobuf:"bytes,16,opt,name=comparator,proto3" json:"comparator,omitempty"`
|
||||
Format string `protobuf:"bytes,17,opt,name=format,proto3" json:"format,omitempty"`
|
||||
Order string `protobuf:"bytes,18,opt,name=order,proto3" json:"order,omitempty"`
|
||||
Dir string `protobuf:"bytes,19,opt,name=dir,proto3" json:"dir,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -255,6 +257,20 @@ func (x *PageMetadata) GetFormat() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PageMetadata) GetOrder() string {
|
||||
if x != nil {
|
||||
return x.Order
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PageMetadata) GetDir() string {
|
||||
if x != nil {
|
||||
return x.Dir
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ReadMessagesRes struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
|
||||
@@ -706,7 +722,7 @@ var File_readers_v1_readers_proto protoreflect.FileDescriptor
|
||||
const file_readers_v1_readers_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x18readers/v1/readers.proto\x12\n" +
|
||||
"readers.v1\"\xe4\x03\n" +
|
||||
"readers.v1\"\x8c\x04\n" +
|
||||
"\fPageMetadata\x12\x14\n" +
|
||||
"\x05limit\x18\x01 \x01(\x04R\x05limit\x12\x16\n" +
|
||||
"\x06offset\x18\x02 \x01(\x04R\x06offset\x12\x1a\n" +
|
||||
@@ -729,7 +745,9 @@ const file_readers_v1_readers_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"comparator\x18\x10 \x01(\tR\n" +
|
||||
"comparator\x12\x16\n" +
|
||||
"\x06format\x18\x11 \x01(\tR\x06format\"\x97\x01\n" +
|
||||
"\x06format\x18\x11 \x01(\tR\x06format\x12\x14\n" +
|
||||
"\x05order\x18\x12 \x01(\tR\x05order\x12\x10\n" +
|
||||
"\x03dir\x18\x13 \x01(\tR\x03dir\"\x97\x01\n" +
|
||||
"\x0fReadMessagesRes\x12\x14\n" +
|
||||
"\x05total\x18\x01 \x01(\x04R\x05total\x12=\n" +
|
||||
"\rpage_metadata\x18\x02 \x01(\v2\x18.readers.v1.PageMetadataR\fpageMetadata\x12/\n" +
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.30.2
|
||||
// - protoc v3.21.12
|
||||
// source: readers/v1/readers.proto
|
||||
|
||||
package v1
|
||||
|
||||
@@ -32,6 +32,8 @@ message PageMetadata {
|
||||
Aggregation aggregation = 15;
|
||||
string comparator = 16;
|
||||
string format = 17;
|
||||
string order = 18;
|
||||
string dir = 19;
|
||||
}
|
||||
|
||||
message ReadMessagesRes {
|
||||
|
||||
@@ -95,6 +95,8 @@ func decodeReadMessagesResponse(_ context.Context, grpcRes any) (any, error) {
|
||||
PageMetadata: readers.PageMetadata{
|
||||
Offset: res.GetPageMetadata().GetOffset(),
|
||||
Limit: res.GetPageMetadata().GetLimit(),
|
||||
Order: res.GetPageMetadata().GetOrder(),
|
||||
Dir: res.GetPageMetadata().GetDir(),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
@@ -121,6 +123,8 @@ func encodeReadMessagesRequest(_ context.Context, grpcReq any) (any, error) {
|
||||
StringValue: req.pageMeta.StringValue,
|
||||
DataValue: req.pageMeta.DataValue,
|
||||
Format: req.pageMeta.Format,
|
||||
Order: req.pageMeta.Order,
|
||||
Dir: req.pageMeta.Dir,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ func decodeReadMessagesRequest(_ context.Context, grpcReq any) (any, error) {
|
||||
StringValue: req.GetPageMetadata().GetStringValue(),
|
||||
DataValue: req.GetPageMetadata().GetDataValue(),
|
||||
Format: req.GetPageMetadata().GetFormat(),
|
||||
Order: req.GetPageMetadata().GetOrder(),
|
||||
Dir: req.GetPageMetadata().GetDir(),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
@@ -66,6 +68,8 @@ func encodeReadMessagesResponse(_ context.Context, grpcRes any) (any, error) {
|
||||
PageMetadata: &grpcReadersV1.PageMetadata{
|
||||
Offset: res.PageMetadata.Offset,
|
||||
Limit: res.PageMetadata.Limit,
|
||||
Order: res.PageMetadata.Order,
|
||||
Dir: res.PageMetadata.Dir,
|
||||
},
|
||||
}
|
||||
return resp, nil
|
||||
|
||||
Reference in New Issue
Block a user