gRPC generated code for services.
This commit is contained in:
parent
2b743da453
commit
69e783c76c
2 changed files with 558 additions and 12 deletions
304
api/v1/log.pb.go
304
api/v1/log.pb.go
|
|
@ -80,6 +80,194 @@ func (x *Record) GetOffset() uint64 {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ProduceRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ProduceRequest) Reset() {
|
||||||
|
*x = ProduceRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ProduceRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ProduceRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ProduceRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ProduceRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ProduceRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_log_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ProduceRequest) GetRecord() *Record {
|
||||||
|
if x != nil {
|
||||||
|
return x.Record
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProduceResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ProduceResponse) Reset() {
|
||||||
|
*x = ProduceResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ProduceResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ProduceResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ProduceResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ProduceResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ProduceResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_log_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ProduceResponse) GetOffset() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Offset
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type ConsumeRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ConsumeRequest) Reset() {
|
||||||
|
*x = ConsumeRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ConsumeRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ConsumeRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ConsumeRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[3]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ConsumeRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ConsumeRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_log_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ConsumeRequest) GetOffset() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Offset
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type ConsumeResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ConsumeResponse) Reset() {
|
||||||
|
*x = ConsumeResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ConsumeResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ConsumeResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ConsumeResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_v1_log_proto_msgTypes[4]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ConsumeResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ConsumeResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_v1_log_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ConsumeResponse) GetRecord() *Record {
|
||||||
|
if x != nil {
|
||||||
|
return x.Record
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var File_api_v1_log_proto protoreflect.FileDescriptor
|
var File_api_v1_log_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_api_v1_log_proto_rawDesc = []byte{
|
var file_api_v1_log_proto_rawDesc = []byte{
|
||||||
|
|
@ -88,9 +276,39 @@ var file_api_v1_log_proto_rawDesc = []byte{
|
||||||
0x63, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20,
|
0x63, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20,
|
||||||
0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66,
|
0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66,
|
||||||
0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73,
|
0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73,
|
||||||
0x65, 0x74, 0x42, 0x1f, 0x5a, 0x1d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
0x65, 0x74, 0x22, 0x38, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x52, 0x65, 0x71,
|
||||||
0x2f, 0x41, 0x59, 0x4d, 0x31, 0x36, 0x30, 0x37, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x67,
|
0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01,
|
||||||
0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,
|
||||||
|
0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x29, 0x0a, 0x0f,
|
||||||
|
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||||
|
0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52,
|
||||||
|
0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x28, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x75,
|
||||||
|
0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66,
|
||||||
|
0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65,
|
||||||
|
0x74, 0x22, 0x39, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||||
|
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,
|
||||||
|
0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x32, 0x8f, 0x02, 0x0a,
|
||||||
|
0x03, 0x4c, 0x6f, 0x67, 0x12, 0x3c, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x12,
|
||||||
|
0x16, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65,
|
||||||
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31,
|
||||||
|
0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
|
0x22, 0x00, 0x12, 0x3c, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x16, 0x2e,
|
||||||
|
0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43,
|
||||||
|
0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||||
|
0x12, 0x46, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61,
|
||||||
|
0x6d, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75,
|
||||||
|
0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x67, 0x2e,
|
||||||
|
0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
|
0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73,
|
||||||
|
0x75, 0x6d, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x67, 0x2e,
|
||||||
|
0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75,
|
||||||
|
0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x1f,
|
||||||
|
0x5a, 0x1d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x59, 0x4d,
|
||||||
|
0x31, 0x36, 0x30, 0x37, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x67, 0x5f, 0x76, 0x31, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -105,16 +323,30 @@ func file_api_v1_log_proto_rawDescGZIP() []byte {
|
||||||
return file_api_v1_log_proto_rawDescData
|
return file_api_v1_log_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_api_v1_log_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_api_v1_log_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||||
var file_api_v1_log_proto_goTypes = []interface{}{
|
var file_api_v1_log_proto_goTypes = []interface{}{
|
||||||
(*Record)(nil), // 0: log.v1.Record
|
(*Record)(nil), // 0: log.v1.Record
|
||||||
|
(*ProduceRequest)(nil), // 1: log.v1.ProduceRequest
|
||||||
|
(*ProduceResponse)(nil), // 2: log.v1.ProduceResponse
|
||||||
|
(*ConsumeRequest)(nil), // 3: log.v1.ConsumeRequest
|
||||||
|
(*ConsumeResponse)(nil), // 4: log.v1.ConsumeResponse
|
||||||
}
|
}
|
||||||
var file_api_v1_log_proto_depIdxs = []int32{
|
var file_api_v1_log_proto_depIdxs = []int32{
|
||||||
0, // [0:0] is the sub-list for method output_type
|
0, // 0: log.v1.ProduceRequest.record:type_name -> log.v1.Record
|
||||||
0, // [0:0] is the sub-list for method input_type
|
0, // 1: log.v1.ConsumeResponse.record:type_name -> log.v1.Record
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
1, // 2: log.v1.Log.Produce:input_type -> log.v1.ProduceRequest
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
3, // 3: log.v1.Log.Consume:input_type -> log.v1.ConsumeRequest
|
||||||
0, // [0:0] is the sub-list for field type_name
|
1, // 4: log.v1.Log.ProduceStream:input_type -> log.v1.ProduceRequest
|
||||||
|
3, // 5: log.v1.Log.ConsumeStream:input_type -> log.v1.ConsumeRequest
|
||||||
|
2, // 6: log.v1.Log.Produce:output_type -> log.v1.ProduceResponse
|
||||||
|
4, // 7: log.v1.Log.Consume:output_type -> log.v1.ConsumeResponse
|
||||||
|
2, // 8: log.v1.Log.ProduceStream:output_type -> log.v1.ProduceResponse
|
||||||
|
4, // 9: log.v1.Log.ConsumeStream:output_type -> log.v1.ConsumeResponse
|
||||||
|
6, // [6:10] is the sub-list for method output_type
|
||||||
|
2, // [2:6] is the sub-list for method input_type
|
||||||
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
2, // [2:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:2] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_api_v1_log_proto_init() }
|
func init() { file_api_v1_log_proto_init() }
|
||||||
|
|
@ -135,6 +367,54 @@ func file_api_v1_log_proto_init() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_api_v1_log_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ProduceRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v1_log_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ProduceResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v1_log_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ConsumeRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_api_v1_log_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ConsumeResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
|
|
@ -142,9 +422,9 @@ func file_api_v1_log_proto_init() {
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_api_v1_log_proto_rawDesc,
|
RawDescriptor: file_api_v1_log_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 1,
|
NumMessages: 5,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
GoTypes: file_api_v1_log_proto_goTypes,
|
GoTypes: file_api_v1_log_proto_goTypes,
|
||||||
DependencyIndexes: file_api_v1_log_proto_depIdxs,
|
DependencyIndexes: file_api_v1_log_proto_depIdxs,
|
||||||
|
|
|
||||||
266
api/v1/log_grpc.pb.go
Normal file
266
api/v1/log_grpc.pb.go
Normal file
|
|
@ -0,0 +1,266 @@
|
||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package log_v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// LogClient is the client API for Log service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type LogClient interface {
|
||||||
|
Produce(ctx context.Context, in *ProduceRequest, opts ...grpc.CallOption) (*ProduceResponse, error)
|
||||||
|
Consume(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (*ConsumeResponse, error)
|
||||||
|
ProduceStream(ctx context.Context, opts ...grpc.CallOption) (Log_ProduceStreamClient, error)
|
||||||
|
ConsumeStream(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (Log_ConsumeStreamClient, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type logClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLogClient(cc grpc.ClientConnInterface) LogClient {
|
||||||
|
return &logClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *logClient) Produce(ctx context.Context, in *ProduceRequest, opts ...grpc.CallOption) (*ProduceResponse, error) {
|
||||||
|
out := new(ProduceResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/log.v1.Log/Produce", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *logClient) Consume(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (*ConsumeResponse, error) {
|
||||||
|
out := new(ConsumeResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/log.v1.Log/Consume", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *logClient) ProduceStream(ctx context.Context, opts ...grpc.CallOption) (Log_ProduceStreamClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &_Log_serviceDesc.Streams[0], "/log.v1.Log/ProduceStream", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &logProduceStreamClient{stream}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Log_ProduceStreamClient interface {
|
||||||
|
Send(*ProduceRequest) error
|
||||||
|
Recv() (*ProduceResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type logProduceStreamClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *logProduceStreamClient) Send(m *ProduceRequest) error {
|
||||||
|
return x.ClientStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *logProduceStreamClient) Recv() (*ProduceResponse, error) {
|
||||||
|
m := new(ProduceResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *logClient) ConsumeStream(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (Log_ConsumeStreamClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &_Log_serviceDesc.Streams[1], "/log.v1.Log/ConsumeStream", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &logConsumeStreamClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Log_ConsumeStreamClient interface {
|
||||||
|
Recv() (*ConsumeResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type logConsumeStreamClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *logConsumeStreamClient) Recv() (*ConsumeResponse, error) {
|
||||||
|
m := new(ConsumeResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// LogServer is the server API for Log service.
|
||||||
|
// All implementations must embed UnimplementedLogServer
|
||||||
|
// for forward compatibility
|
||||||
|
type LogServer interface {
|
||||||
|
Produce(context.Context, *ProduceRequest) (*ProduceResponse, error)
|
||||||
|
Consume(context.Context, *ConsumeRequest) (*ConsumeResponse, error)
|
||||||
|
ProduceStream(Log_ProduceStreamServer) error
|
||||||
|
ConsumeStream(*ConsumeRequest, Log_ConsumeStreamServer) error
|
||||||
|
mustEmbedUnimplementedLogServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedLogServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedLogServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedLogServer) Produce(context.Context, *ProduceRequest) (*ProduceResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Produce not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLogServer) Consume(context.Context, *ConsumeRequest) (*ConsumeResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Consume not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLogServer) ProduceStream(Log_ProduceStreamServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method ProduceStream not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLogServer) ConsumeStream(*ConsumeRequest, Log_ConsumeStreamServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method ConsumeStream not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLogServer) mustEmbedUnimplementedLogServer() {}
|
||||||
|
|
||||||
|
// UnsafeLogServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to LogServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeLogServer interface {
|
||||||
|
mustEmbedUnimplementedLogServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterLogServer(s *grpc.Server, srv LogServer) {
|
||||||
|
s.RegisterService(&_Log_serviceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Log_Produce_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ProduceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LogServer).Produce(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/log.v1.Log/Produce",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LogServer).Produce(ctx, req.(*ProduceRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Log_Consume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ConsumeRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LogServer).Consume(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/log.v1.Log/Consume",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LogServer).Consume(ctx, req.(*ConsumeRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Log_ProduceStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
return srv.(LogServer).ProduceStream(&logProduceStreamServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Log_ProduceStreamServer interface {
|
||||||
|
Send(*ProduceResponse) error
|
||||||
|
Recv() (*ProduceRequest, error)
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type logProduceStreamServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *logProduceStreamServer) Send(m *ProduceResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *logProduceStreamServer) Recv() (*ProduceRequest, error) {
|
||||||
|
m := new(ProduceRequest)
|
||||||
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Log_ConsumeStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(ConsumeRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(LogServer).ConsumeStream(m, &logConsumeStreamServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Log_ConsumeStreamServer interface {
|
||||||
|
Send(*ConsumeResponse) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type logConsumeStreamServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *logConsumeStreamServer) Send(m *ConsumeResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _Log_serviceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "log.v1.Log",
|
||||||
|
HandlerType: (*LogServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Produce",
|
||||||
|
Handler: _Log_Produce_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Consume",
|
||||||
|
Handler: _Log_Consume_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "ProduceStream",
|
||||||
|
Handler: _Log_ProduceStream_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
ClientStreams: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
StreamName: "ConsumeStream",
|
||||||
|
Handler: _Log_ConsumeStream_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Metadata: "api/v1/log.proto",
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue