pkg/protocol/sls_logs_transfer.pb.go (456 lines of code) (raw):
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: sls_logs_transfer.proto
package protocol
import (
context "context"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
proto "github.com/gogo/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ResponseCode int32
const (
ResponseCode_Success ResponseCode = 0
ResponseCode_Failure ResponseCode = 1
)
var ResponseCode_name = map[int32]string{
0: "Success",
1: "Failure",
}
var ResponseCode_value = map[string]int32{
"Success": 0,
"Failure": 1,
}
func (x ResponseCode) Enum() *ResponseCode {
p := new(ResponseCode)
*p = x
return p
}
func (x ResponseCode) String() string {
return proto.EnumName(ResponseCode_name, int32(x))
}
func (x *ResponseCode) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(ResponseCode_value, data, "ResponseCode")
if err != nil {
return err
}
*x = ResponseCode(value)
return nil
}
func (ResponseCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_6bc5040594756632, []int{0}
}
type Response struct {
Code ResponseCode `protobuf:"varint,1,req,name=code,enum=sls_logs.ResponseCode" json:"code"`
Message string `protobuf:"bytes,2,req,name=message" json:"message"`
}
func (m *Response) Reset() { *m = Response{} }
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) {
return fileDescriptor_6bc5040594756632, []int{0}
}
func (m *Response) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Response.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Response) XXX_Merge(src proto.Message) {
xxx_messageInfo_Response.Merge(m, src)
}
func (m *Response) XXX_Size() int {
return m.Size()
}
func (m *Response) XXX_DiscardUnknown() {
xxx_messageInfo_Response.DiscardUnknown(m)
}
var xxx_messageInfo_Response proto.InternalMessageInfo
func (m *Response) GetCode() ResponseCode {
if m != nil {
return m.Code
}
return ResponseCode_Success
}
func (m *Response) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
func init() {
proto.RegisterEnum("sls_logs.ResponseCode", ResponseCode_name, ResponseCode_value)
proto.RegisterType((*Response)(nil), "sls_logs.Response")
}
func init() { proto.RegisterFile("sls_logs_transfer.proto", fileDescriptor_6bc5040594756632) }
var fileDescriptor_6bc5040594756632 = []byte{
// 281 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xcf, 0x4a, 0xf3, 0x40,
0x14, 0xc5, 0x67, 0x4a, 0xa1, 0xfd, 0xe6, 0x93, 0x52, 0x66, 0xa1, 0x25, 0x8b, 0xb1, 0x74, 0x15,
0x04, 0x1b, 0x29, 0xfa, 0x02, 0x15, 0x14, 0xa1, 0xab, 0x74, 0x27, 0x42, 0x49, 0xa7, 0xb7, 0x63,
0x70, 0x9a, 0x3b, 0xcc, 0x1f, 0x9f, 0xc3, 0xc7, 0xea, 0xb2, 0x4b, 0x57, 0x22, 0xc9, 0x8b, 0x88,
0x89, 0x51, 0xc1, 0xdd, 0xfc, 0xe6, 0xfc, 0x0e, 0x1c, 0x2e, 0x3b, 0x71, 0xda, 0xad, 0x34, 0x2a,
0xb7, 0xf2, 0x36, 0x2b, 0xdc, 0x16, 0xec, 0xd4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0xff, 0x45, 0x20, 0x1d, 0x03, 0x6b, 0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// 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.SupportPackageIsVersion4
// LogReportServiceClient is the client API for LogReportService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type LogReportServiceClient interface {
Collect(ctx context.Context, opts ...grpc.CallOption) (LogReportService_CollectClient, error)
}
type logReportServiceClient struct {
cc *grpc.ClientConn
}
func NewLogReportServiceClient(cc *grpc.ClientConn) LogReportServiceClient {
return &logReportServiceClient{cc}
}
func (c *logReportServiceClient) Collect(ctx context.Context, opts ...grpc.CallOption) (LogReportService_CollectClient, error) {
stream, err := c.cc.NewStream(ctx, &_LogReportService_serviceDesc.Streams[0], "/sls_logs.LogReportService/collect", opts...)
if err != nil {
return nil, err
}
x := &logReportServiceCollectClient{stream}
return x, nil
}
type LogReportService_CollectClient interface {
Send(*LogGroup) error
CloseAndRecv() (*Response, error)
grpc.ClientStream
}
type logReportServiceCollectClient struct {
grpc.ClientStream
}
func (x *logReportServiceCollectClient) Send(m *LogGroup) error {
return x.ClientStream.SendMsg(m)
}
func (x *logReportServiceCollectClient) CloseAndRecv() (*Response, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(Response)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// LogReportServiceServer is the server API for LogReportService service.
type LogReportServiceServer interface {
Collect(LogReportService_CollectServer) error
}
// UnimplementedLogReportServiceServer can be embedded to have forward compatible implementations.
type UnimplementedLogReportServiceServer struct {
}
func (*UnimplementedLogReportServiceServer) Collect(srv LogReportService_CollectServer) error {
return status.Errorf(codes.Unimplemented, "method Collect not implemented")
}
func RegisterLogReportServiceServer(s *grpc.Server, srv LogReportServiceServer) {
s.RegisterService(&_LogReportService_serviceDesc, srv)
}
func _LogReportService_Collect_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(LogReportServiceServer).Collect(&logReportServiceCollectServer{stream})
}
type LogReportService_CollectServer interface {
SendAndClose(*Response) error
Recv() (*LogGroup, error)
grpc.ServerStream
}
type logReportServiceCollectServer struct {
grpc.ServerStream
}
func (x *logReportServiceCollectServer) SendAndClose(m *Response) error {
return x.ServerStream.SendMsg(m)
}
func (x *logReportServiceCollectServer) Recv() (*LogGroup, error) {
m := new(LogGroup)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _LogReportService_serviceDesc = grpc.ServiceDesc{
ServiceName: "sls_logs.LogReportService",
HandlerType: (*LogReportServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "collect",
Handler: _LogReportService_Collect_Handler,
ClientStreams: true,
},
},
Metadata: "sls_logs_transfer.proto",
}
func (m *Response) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Response) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
i -= len(m.Message)
copy(dAtA[i:], m.Message)
i = encodeVarintSlsLogsTransfer(dAtA, i, uint64(len(m.Message)))
i--
dAtA[i] = 0x12
i = encodeVarintSlsLogsTransfer(dAtA, i, uint64(m.Code))
i--
dAtA[i] = 0x8
return len(dAtA) - i, nil
}
func encodeVarintSlsLogsTransfer(dAtA []byte, offset int, v uint64) int {
offset -= sovSlsLogsTransfer(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Response) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
n += 1 + sovSlsLogsTransfer(uint64(m.Code))
l = len(m.Message)
n += 1 + l + sovSlsLogsTransfer(uint64(l))
return n
}
func sovSlsLogsTransfer(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozSlsLogsTransfer(x uint64) (n int) {
return sovSlsLogsTransfer(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Response) Unmarshal(dAtA []byte) error {
var hasFields [1]uint64
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSlsLogsTransfer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Response: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
}
m.Code = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSlsLogsTransfer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Code |= ResponseCode(b&0x7F) << shift
if b < 0x80 {
break
}
}
hasFields[0] |= uint64(0x00000001)
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSlsLogsTransfer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSlsLogsTransfer
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSlsLogsTransfer
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Message = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
hasFields[0] |= uint64(0x00000002)
default:
iNdEx = preIndex
skippy, err := skipSlsLogsTransfer(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSlsLogsTransfer
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if hasFields[0]&uint64(0x00000001) == 0 {
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("code")
}
if hasFields[0]&uint64(0x00000002) == 0 {
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message")
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipSlsLogsTransfer(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSlsLogsTransfer
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSlsLogsTransfer
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSlsLogsTransfer
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthSlsLogsTransfer
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupSlsLogsTransfer
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthSlsLogsTransfer
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthSlsLogsTransfer = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowSlsLogsTransfer = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupSlsLogsTransfer = fmt.Errorf("proto: unexpected end of group")
)