Skip to content

Commit

Permalink
make proto/add & make format
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Sep 22, 2022
1 parent c996f51 commit 1b1af8c
Show file tree
Hide file tree
Showing 13 changed files with 1,454 additions and 418 deletions.
73 changes: 73 additions & 0 deletions apis/docs/v1/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
- [apis/proto/v1/manager/index/index_manager.proto](#apis_proto_v1_manager_index_index_manager-proto)
- [Index](#manager-index-v1-Index)

- [apis/proto/v1/mirroring/mirroring.proto](#apis_proto_v1_mirroring_mirroring-proto)
- [Mirroring](#mirroring-v1-Mirroring)

- [apis/proto/v1/payload/payload.proto](#apis_proto_v1_payload_payload-proto)
- [Control](#payload-v1-Control)
- [Control.CreateIndexRequest](#payload-v1-Control-CreateIndexRequest)
Expand Down Expand Up @@ -49,6 +52,9 @@
- [Insert.MultiRequest](#payload-v1-Insert-MultiRequest)
- [Insert.ObjectRequest](#payload-v1-Insert-ObjectRequest)
- [Insert.Request](#payload-v1-Insert-Request)
- [Mirroring](#payload-v1-Mirroring)
- [Mirroring.Request](#payload-v1-Mirroring-Request)
- [Mirroring.Target](#payload-v1-Mirroring-Target)
- [Object](#payload-v1-Object)
- [Object.Blob](#payload-v1-Object-Blob)
- [Object.Distance](#payload-v1-Object-Distance)
Expand Down Expand Up @@ -278,6 +284,32 @@ Represent the index manager service.



<a name="apis_proto_v1_mirroring_mirroring-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## apis/proto/v1/mirroring/mirroring.proto









<a name="mirroring-v1-Mirroring"></a>

### Mirroring
Represent the mirroring service.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Register | [.payload.v1.Mirroring.Request](#payload-v1-Mirroring-Request) | [.payload.v1.Empty](#payload-v1-Empty) | Register the RPC to register other mirroring servers. |





<a name="apis_proto_v1_payload_payload-proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down Expand Up @@ -676,6 +708,47 @@ Represent the insert request.



<a name="payload-v1-Mirroring"></a>

### Mirroring
Mirroring related messages.






<a name="payload-v1-Mirroring-Request"></a>

### Mirroring.Request
Represent the mirroring request.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| targets | [Mirroring.Target](#payload-v1-Mirroring-Target) | repeated | The mirroring server targets. |






<a name="payload-v1-Mirroring-Target"></a>

### Mirroring.Target
Request server information.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ip | [string](#string) | | The target ip. |
| port | [uint32](#uint32) | | The target port. |






<a name="payload-v1-Object"></a>

### Object
Expand Down
99 changes: 99 additions & 0 deletions apis/grpc/v1/mirroring/mirroring.pb.go
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
}
127 changes: 127 additions & 0 deletions apis/grpc/v1/mirroring/mirroring_vtproto.pb.go
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",
}
Loading

0 comments on commit 1b1af8c

Please sign in to comment.