-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: hlts2 <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,454 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// | ||
// 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 | ||
// | ||
// https://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. | ||
// | ||
|
||
package mirroring | ||
|
||
import ( | ||
reflect "reflect" | ||
|
||
payload "github.com/vdaas/vald/apis/grpc/v1/payload" | ||
_ "google.golang.org/genproto/googleapis/api/annotations" | ||
protoreflect "google.golang.org/protobuf/reflect/protoreflect" | ||
protoimpl "google.golang.org/protobuf/runtime/protoimpl" | ||
) | ||
|
||
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) | ||
) | ||
|
||
var File_apis_proto_v1_mirroring_mirroring_proto protoreflect.FileDescriptor | ||
|
||
var file_apis_proto_v1_mirroring_mirroring_proto_rawDesc = []byte{ | ||
0x0a, 0x27, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, | ||
0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, | ||
0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x69, 0x72, 0x72, 0x6f, | ||
0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x72, | ||
0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x70, | ||
0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3d, 0x67, 0x69, | ||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, | ||
0x70, 0x69, 0x73, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 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, 0x32, 0x69, 0x0a, 0x09, 0x4d, | ||
0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x5c, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, | ||
0x73, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, | ||
0x31, 0x2e, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, | ||
0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x76, 0x31, | ||
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, | ||
0x2f, 0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, | ||
0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x42, 0x60, 0x0a, 0x1f, 0x6f, 0x72, 0x67, 0x2e, 0x76, 0x64, | ||
0x61, 0x61, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, | ||
0x6d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x0d, 0x56, 0x61, 0x6c, 0x64, 0x4d, | ||
0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, | ||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x64, 0x61, 0x61, 0x73, 0x2f, 0x76, 0x61, 0x6c, | ||
0x64, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6d, | ||
0x69, 0x72, 0x72, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, | ||
} | ||
|
||
var file_apis_proto_v1_mirroring_mirroring_proto_goTypes = []interface{}{ | ||
(*payload.Mirroring_Request)(nil), // 0: payload.v1.Mirroring.Request | ||
(*payload.Empty)(nil), // 1: payload.v1.Empty | ||
} | ||
var file_apis_proto_v1_mirroring_mirroring_proto_depIdxs = []int32{ | ||
0, // 0: mirroring.v1.Mirroring.Register:input_type -> payload.v1.Mirroring.Request | ||
1, // 1: mirroring.v1.Mirroring.Register:output_type -> payload.v1.Empty | ||
1, // [1:2] is the sub-list for method output_type | ||
0, // [0:1] is the sub-list for method input_type | ||
0, // [0:0] is the sub-list for extension type_name | ||
0, // [0:0] is the sub-list for extension extendee | ||
0, // [0:0] is the sub-list for field type_name | ||
} | ||
|
||
func init() { file_apis_proto_v1_mirroring_mirroring_proto_init() } | ||
func file_apis_proto_v1_mirroring_mirroring_proto_init() { | ||
if File_apis_proto_v1_mirroring_mirroring_proto != nil { | ||
return | ||
} | ||
type x struct{} | ||
out := protoimpl.TypeBuilder{ | ||
File: protoimpl.DescBuilder{ | ||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), | ||
RawDescriptor: file_apis_proto_v1_mirroring_mirroring_proto_rawDesc, | ||
NumEnums: 0, | ||
NumMessages: 0, | ||
NumExtensions: 0, | ||
NumServices: 1, | ||
}, | ||
GoTypes: file_apis_proto_v1_mirroring_mirroring_proto_goTypes, | ||
DependencyIndexes: file_apis_proto_v1_mirroring_mirroring_proto_depIdxs, | ||
}.Build() | ||
File_apis_proto_v1_mirroring_mirroring_proto = out.File | ||
file_apis_proto_v1_mirroring_mirroring_proto_rawDesc = nil | ||
file_apis_proto_v1_mirroring_mirroring_proto_goTypes = nil | ||
file_apis_proto_v1_mirroring_mirroring_proto_depIdxs = nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// | ||
// 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 | ||
// | ||
// https://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. | ||
// | ||
|
||
package mirroring | ||
|
||
import ( | ||
context "context" | ||
|
||
payload "github.com/vdaas/vald/apis/grpc/v1/payload" | ||
codes "github.com/vdaas/vald/internal/net/grpc/codes" | ||
status "github.com/vdaas/vald/internal/net/grpc/status" | ||
grpc "google.golang.org/grpc" | ||
protoimpl "google.golang.org/protobuf/runtime/protoimpl" | ||
) | ||
|
||
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 grpc package it is being compiled against. | ||
// Requires gRPC-Go v1.32.0 or later. | ||
const _ = grpc.SupportPackageIsVersion7 | ||
|
||
// MirroringClient is the client API for Mirroring 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 MirroringClient interface { | ||
// Register the RPC to register other mirroring servers. | ||
Register(ctx context.Context, in *payload.Mirroring_Request, opts ...grpc.CallOption) (*payload.Empty, error) | ||
} | ||
|
||
type mirroringClient struct { | ||
cc grpc.ClientConnInterface | ||
} | ||
|
||
func NewMirroringClient(cc grpc.ClientConnInterface) MirroringClient { | ||
return &mirroringClient{cc} | ||
} | ||
|
||
func (c *mirroringClient) Register(ctx context.Context, in *payload.Mirroring_Request, opts ...grpc.CallOption) (*payload.Empty, error) { | ||
out := new(payload.Empty) | ||
err := c.cc.Invoke(ctx, "/mirroring.v1.Mirroring/Register", in, out, opts...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return out, nil | ||
} | ||
|
||
// MirroringServer is the server API for Mirroring service. | ||
// All implementations must embed UnimplementedMirroringServer | ||
// for forward compatibility | ||
type MirroringServer interface { | ||
// Register the RPC to register other mirroring servers. | ||
Register(context.Context, *payload.Mirroring_Request) (*payload.Empty, error) | ||
mustEmbedUnimplementedMirroringServer() | ||
} | ||
|
||
// UnimplementedMirroringServer must be embedded to have forward compatible implementations. | ||
type UnimplementedMirroringServer struct { | ||
} | ||
|
||
func (UnimplementedMirroringServer) Register(context.Context, *payload.Mirroring_Request) (*payload.Empty, error) { | ||
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") | ||
} | ||
func (UnimplementedMirroringServer) mustEmbedUnimplementedMirroringServer() {} | ||
|
||
// UnsafeMirroringServer may be embedded to opt out of forward compatibility for this service. | ||
// Use of this interface is not recommended, as added methods to MirroringServer will | ||
// result in compilation errors. | ||
type UnsafeMirroringServer interface { | ||
mustEmbedUnimplementedMirroringServer() | ||
} | ||
|
||
func RegisterMirroringServer(s grpc.ServiceRegistrar, srv MirroringServer) { | ||
s.RegisterService(&Mirroring_ServiceDesc, srv) | ||
} | ||
|
||
func _Mirroring_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
in := new(payload.Mirroring_Request) | ||
if err := dec(in); err != nil { | ||
return nil, err | ||
} | ||
if interceptor == nil { | ||
return srv.(MirroringServer).Register(ctx, in) | ||
} | ||
info := &grpc.UnaryServerInfo{ | ||
Server: srv, | ||
FullMethod: "/mirroring.v1.Mirroring/Register", | ||
} | ||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
return srv.(MirroringServer).Register(ctx, req.(*payload.Mirroring_Request)) | ||
} | ||
return interceptor(ctx, in, info, handler) | ||
} | ||
|
||
// Mirroring_ServiceDesc is the grpc.ServiceDesc for Mirroring service. | ||
// It's only intended for direct use with grpc.RegisterService, | ||
// and not to be introspected or modified (even as a copy) | ||
var Mirroring_ServiceDesc = grpc.ServiceDesc{ | ||
ServiceName: "mirroring.v1.Mirroring", | ||
HandlerType: (*MirroringServer)(nil), | ||
Methods: []grpc.MethodDesc{ | ||
{ | ||
MethodName: "Register", | ||
Handler: _Mirroring_Register_Handler, | ||
}, | ||
}, | ||
Streams: []grpc.StreamDesc{}, | ||
Metadata: "apis/proto/v1/mirroring/mirroring.proto", | ||
} |
Oops, something went wrong.