From aa119e22f0a279726b5b1836e7d8e58b1905ddda Mon Sep 17 00:00:00 2001 From: Denis Tingajkin Date: Tue, 20 Oct 2020 20:27:33 +0700 Subject: [PATCH] update go-generate job Signed-off-by: Denis Tingajkin --- .github/workflows/ci.yaml | 4 +- pkg/tools/callback/callback.pb.go | 257 ++++++++++++++++++++++-------- 2 files changed, 189 insertions(+), 72 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 630106b7c..4a22c53fb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -91,9 +91,9 @@ jobs: version: '3.8.0' - uses: actions/setup-go@v1 with: - go-version: 1.13 + go-version: 1.15 - name: Install proto-gen-go - run: go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.3 + run: go get -u github.com/golang/protobuf/protoc-gen-go@v1.4.2 - name: Install proto-gen-go run: go get github.com/searKing/golang/tools/cmd/go-syncmap - name: Generate files diff --git a/pkg/tools/callback/callback.pb.go b/pkg/tools/callback/callback.pb.go index 1a2415318..635c0fddc 100644 --- a/pkg/tools/callback/callback.pb.go +++ b/pkg/tools/callback/callback.pb.go @@ -1,28 +1,49 @@ +// Copyright (c) 2020 Doc.ai and/or its affiliates. +// +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.8.0 // source: callback.proto package callback import ( context "context" - fmt "fmt" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// 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.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type DataKind int32 @@ -31,92 +52,188 @@ const ( DataKind_Close DataKind = 1 ) -var DataKind_name = map[int32]string{ - 0: "Data", - 1: "Close", -} +// Enum value maps for DataKind. +var ( + DataKind_name = map[int32]string{ + 0: "Data", + 1: "Close", + } + DataKind_value = map[string]int32{ + "Data": 0, + "Close": 1, + } +) -var DataKind_value = map[string]int32{ - "Data": 0, - "Close": 1, +func (x DataKind) Enum() *DataKind { + p := new(DataKind) + *p = x + return p } func (x DataKind) String() string { - return proto.EnumName(DataKind_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (DataKind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6cf7fe261a3a1c45, []int{0} +func (DataKind) Descriptor() protoreflect.EnumDescriptor { + return file_callback_proto_enumTypes[0].Descriptor() } -// Callback binary stream -type CallbackData struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Kind DataKind `protobuf:"varint,2,opt,name=kind,proto3,enum=callback.DataKind" json:"kind,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (DataKind) Type() protoreflect.EnumType { + return &file_callback_proto_enumTypes[0] } -func (m *CallbackData) Reset() { *m = CallbackData{} } -func (m *CallbackData) String() string { return proto.CompactTextString(m) } -func (*CallbackData) ProtoMessage() {} -func (*CallbackData) Descriptor() ([]byte, []int) { - return fileDescriptor_6cf7fe261a3a1c45, []int{0} +func (x DataKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *CallbackData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CallbackData.Unmarshal(m, b) +// Deprecated: Use DataKind.Descriptor instead. +func (DataKind) EnumDescriptor() ([]byte, []int) { + return file_callback_proto_rawDescGZIP(), []int{0} } -func (m *CallbackData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CallbackData.Marshal(b, m, deterministic) + +// Callback binary stream +type CallbackData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Kind DataKind `protobuf:"varint,2,opt,name=kind,proto3,enum=callback.DataKind" json:"kind,omitempty"` } -func (m *CallbackData) XXX_Merge(src proto.Message) { - xxx_messageInfo_CallbackData.Merge(m, src) + +func (x *CallbackData) Reset() { + *x = CallbackData{} + if protoimpl.UnsafeEnabled { + mi := &file_callback_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CallbackData) XXX_Size() int { - return xxx_messageInfo_CallbackData.Size(m) + +func (x *CallbackData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CallbackData) XXX_DiscardUnknown() { - xxx_messageInfo_CallbackData.DiscardUnknown(m) + +func (*CallbackData) ProtoMessage() {} + +func (x *CallbackData) ProtoReflect() protoreflect.Message { + mi := &file_callback_proto_msgTypes[0] + 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) } -var xxx_messageInfo_CallbackData proto.InternalMessageInfo +// Deprecated: Use CallbackData.ProtoReflect.Descriptor instead. +func (*CallbackData) Descriptor() ([]byte, []int) { + return file_callback_proto_rawDescGZIP(), []int{0} +} -func (m *CallbackData) GetData() []byte { - if m != nil { - return m.Data +func (x *CallbackData) GetData() []byte { + if x != nil { + return x.Data } return nil } -func (m *CallbackData) GetKind() DataKind { - if m != nil { - return m.Kind +func (x *CallbackData) GetKind() DataKind { + if x != nil { + return x.Kind } return DataKind_Data } -func init() { - proto.RegisterEnum("callback.DataKind", DataKind_name, DataKind_value) - proto.RegisterType((*CallbackData)(nil), "callback.CallbackData") -} - -func init() { proto.RegisterFile("callback.proto", fileDescriptor_6cf7fe261a3a1c45) } +var File_callback_proto protoreflect.FileDescriptor + +var file_callback_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x22, 0x4a, 0x0a, 0x0c, 0x43, 0x61, + 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x26, + 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, + 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x69, 0x6e, 0x64, + 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x2a, 0x1f, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x69, + 0x6e, 0x64, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, + 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x01, 0x32, 0x58, 0x0a, 0x0f, 0x43, 0x61, 0x6c, 0x6c, 0x62, + 0x61, 0x63, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x12, 0x16, 0x2e, + 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, + 0x6b, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x16, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, + 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_callback_proto_rawDescOnce sync.Once + file_callback_proto_rawDescData = file_callback_proto_rawDesc +) -var fileDescriptor_6cf7fe261a3a1c45 = []byte{ - // 169 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0x4e, 0xcc, 0xc9, - 0x49, 0x4a, 0x4c, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0x95, 0xbc, - 0xb8, 0x78, 0x9c, 0xa1, 0x6c, 0x97, 0xc4, 0x92, 0x44, 0x21, 0x21, 0x2e, 0x96, 0x94, 0xc4, 0x92, - 0x44, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x9e, 0x20, 0x30, 0x5b, 0x48, 0x8d, 0x8b, 0x25, 0x3b, 0x33, - 0x2f, 0x45, 0x82, 0x49, 0x81, 0x51, 0x83, 0xcf, 0x48, 0x48, 0x0f, 0x6e, 0x18, 0x48, 0x87, 0x77, - 0x66, 0x5e, 0x4a, 0x10, 0x58, 0x5e, 0x4b, 0x9e, 0x8b, 0x03, 0x26, 0x22, 0xc4, 0xc1, 0xc5, 0x02, - 0x62, 0x0b, 0x30, 0x08, 0x71, 0x72, 0xb1, 0x3a, 0xe7, 0xe4, 0x17, 0xa7, 0x0a, 0x30, 0x1a, 0x45, - 0x70, 0xf1, 0xc3, 0x2c, 0x0b, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x15, 0x72, 0xe5, 0xe2, 0xf7, - 0x48, 0xcc, 0x4b, 0xc9, 0x49, 0x85, 0x49, 0x14, 0x0b, 0x89, 0x21, 0x2c, 0x40, 0x76, 0x9a, 0x14, - 0x0e, 0x71, 0x0d, 0x46, 0x03, 0xc6, 0x24, 0x36, 0xb0, 0xbf, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x5d, 0xf2, 0x29, 0x0f, 0xe9, 0x00, 0x00, 0x00, +func file_callback_proto_rawDescGZIP() []byte { + file_callback_proto_rawDescOnce.Do(func() { + file_callback_proto_rawDescData = protoimpl.X.CompressGZIP(file_callback_proto_rawDescData) + }) + return file_callback_proto_rawDescData +} + +var file_callback_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_callback_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_callback_proto_goTypes = []interface{}{ + (DataKind)(0), // 0: callback.DataKind + (*CallbackData)(nil), // 1: callback.CallbackData +} +var file_callback_proto_depIdxs = []int32{ + 0, // 0: callback.CallbackData.kind:type_name -> callback.DataKind + 1, // 1: callback.CallbackService.HandleCallbacks:input_type -> callback.CallbackData + 1, // 2: callback.CallbackService.HandleCallbacks:output_type -> callback.CallbackData + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_callback_proto_init() } +func file_callback_proto_init() { + if File_callback_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_callback_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallbackData); 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_callback_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_callback_proto_goTypes, + DependencyIndexes: file_callback_proto_depIdxs, + EnumInfos: file_callback_proto_enumTypes, + MessageInfos: file_callback_proto_msgTypes, + }.Build() + File_callback_proto = out.File + file_callback_proto_rawDesc = nil + file_callback_proto_goTypes = nil + file_callback_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. @@ -182,7 +299,7 @@ type CallbackServiceServer interface { type UnimplementedCallbackServiceServer struct { } -func (*UnimplementedCallbackServiceServer) HandleCallbacks(srv CallbackService_HandleCallbacksServer) error { +func (*UnimplementedCallbackServiceServer) HandleCallbacks(CallbackService_HandleCallbacksServer) error { return status.Errorf(codes.Unimplemented, "method HandleCallbacks not implemented") }