mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
feat: added modules
This commit is contained in:
2
grpc/.gitignore
vendored
Normal file
2
grpc/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.idea/
|
||||
.DS_Store
|
||||
29
grpc/LICENSE
Normal file
29
grpc/LICENSE
Normal file
@@ -0,0 +1,29 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021, Crawlab Team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
2
grpc/README.md
Normal file
2
grpc/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# crawlab-grpc
|
||||
gRPC for Crawlab
|
||||
37
grpc/bin/compile.sh
Executable file
37
grpc/bin/compile.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -L $0 ]
|
||||
then
|
||||
BASE_DIR=`dirname $(readlink $0)`
|
||||
else
|
||||
BASE_DIR=`dirname $0`
|
||||
fi
|
||||
base_path=$(cd $BASE_DIR/..; pwd)
|
||||
|
||||
cd $base_path && \
|
||||
rm -rf dist | true
|
||||
|
||||
cd $base_path && \
|
||||
mkdir -p dist/python | true && \
|
||||
mkdir -p dist/js | true && \
|
||||
mkdir -p dist/ts | true && \
|
||||
mkdir -p dist/java | true && \
|
||||
mkdir -p dist/csharp | true && \
|
||||
mkdir -p dist/php | true && \
|
||||
mkdir -p dist/ruby | true
|
||||
|
||||
cd $base_path && \
|
||||
protoc -I ./proto \
|
||||
--go_out=. \
|
||||
--go-grpc_out=. \
|
||||
--python_out=dist/python \
|
||||
--js_out=dist/js \
|
||||
--java_out=dist/java \
|
||||
--csharp_out=dist/csharp \
|
||||
./proto/**/*.proto
|
||||
|
||||
# python
|
||||
cd $base_path && \
|
||||
python3 -m grpc_tools.protoc -I ./proto \
|
||||
--grpc_python_out=dist/python \
|
||||
./proto/**/*.proto
|
||||
488
grpc/dependencies_service_v2_request.pb.go
Normal file
488
grpc/dependencies_service_v2_request.pb.go
Normal file
@@ -0,0 +1,488 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/dependencies_service_v2_request.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Dependency struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Dependency) Reset() {
|
||||
*x = Dependency{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_dependencies_service_v2_request_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Dependency) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Dependency) ProtoMessage() {}
|
||||
|
||||
func (x *Dependency) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_dependencies_service_v2_request_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use Dependency.ProtoReflect.Descriptor instead.
|
||||
func (*Dependency) Descriptor() ([]byte, []int) {
|
||||
return file_entity_dependencies_service_v2_request_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Dependency) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Dependency) GetVersion() string {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DependenciesServiceV2ConnectRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2ConnectRequest) Reset() {
|
||||
*x = DependenciesServiceV2ConnectRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_dependencies_service_v2_request_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2ConnectRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DependenciesServiceV2ConnectRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DependenciesServiceV2ConnectRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_dependencies_service_v2_request_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 DependenciesServiceV2ConnectRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DependenciesServiceV2ConnectRequest) Descriptor() ([]byte, []int) {
|
||||
return file_entity_dependencies_service_v2_request_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2ConnectRequest) GetNodeKey() string {
|
||||
if x != nil {
|
||||
return x.NodeKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DependenciesServiceV2SyncRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"`
|
||||
Dependencies []*Dependency `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2SyncRequest) Reset() {
|
||||
*x = DependenciesServiceV2SyncRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_dependencies_service_v2_request_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2SyncRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DependenciesServiceV2SyncRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DependenciesServiceV2SyncRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_dependencies_service_v2_request_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 DependenciesServiceV2SyncRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DependenciesServiceV2SyncRequest) Descriptor() ([]byte, []int) {
|
||||
return file_entity_dependencies_service_v2_request_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2SyncRequest) GetNodeKey() string {
|
||||
if x != nil {
|
||||
return x.NodeKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2SyncRequest) GetLang() string {
|
||||
if x != nil {
|
||||
return x.Lang
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2SyncRequest) GetDependencies() []*Dependency {
|
||||
if x != nil {
|
||||
return x.Dependencies
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DependenciesServiceV2InstallRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"`
|
||||
Dependencies []*Dependency `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
|
||||
Proxy string `protobuf:"bytes,4,opt,name=proxy,proto3" json:"proxy,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2InstallRequest) Reset() {
|
||||
*x = DependenciesServiceV2InstallRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_dependencies_service_v2_request_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2InstallRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DependenciesServiceV2InstallRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DependenciesServiceV2InstallRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_dependencies_service_v2_request_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 DependenciesServiceV2InstallRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DependenciesServiceV2InstallRequest) Descriptor() ([]byte, []int) {
|
||||
return file_entity_dependencies_service_v2_request_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2InstallRequest) GetNodeKey() string {
|
||||
if x != nil {
|
||||
return x.NodeKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2InstallRequest) GetLang() string {
|
||||
if x != nil {
|
||||
return x.Lang
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2InstallRequest) GetDependencies() []*Dependency {
|
||||
if x != nil {
|
||||
return x.Dependencies
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2InstallRequest) GetProxy() string {
|
||||
if x != nil {
|
||||
return x.Proxy
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DependenciesServiceV2UninstallRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"`
|
||||
Dependencies []*Dependency `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2UninstallRequest) Reset() {
|
||||
*x = DependenciesServiceV2UninstallRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_dependencies_service_v2_request_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2UninstallRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DependenciesServiceV2UninstallRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DependenciesServiceV2UninstallRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_dependencies_service_v2_request_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 DependenciesServiceV2UninstallRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DependenciesServiceV2UninstallRequest) Descriptor() ([]byte, []int) {
|
||||
return file_entity_dependencies_service_v2_request_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2UninstallRequest) GetNodeKey() string {
|
||||
if x != nil {
|
||||
return x.NodeKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2UninstallRequest) GetLang() string {
|
||||
if x != nil {
|
||||
return x.Lang
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DependenciesServiceV2UninstallRequest) GetDependencies() []*Dependency {
|
||||
if x != nil {
|
||||
return x.Dependencies
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_entity_dependencies_service_v2_request_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_dependencies_service_v2_request_proto_rawDesc = []byte{
|
||||
0x0a, 0x2c, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65,
|
||||
0x6e, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32,
|
||||
0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04,
|
||||
0x67, 0x72, 0x70, 0x63, 0x22, 0x3a, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e,
|
||||
0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x22, 0x40, 0x0a, 0x23, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f,
|
||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b,
|
||||
0x65, 0x79, 0x22, 0x87, 0x01, 0x0a, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63,
|
||||
0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x53, 0x79, 0x6e, 0x63,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f,
|
||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b,
|
||||
0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64,
|
||||
0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c,
|
||||
0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0xa0, 0x01, 0x0a,
|
||||
0x23, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c,
|
||||
0x61, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63,
|
||||
0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70,
|
||||
0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f,
|
||||
0x78, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x22,
|
||||
0x8c, 0x01, 0x0a, 0x25, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61,
|
||||
0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64,
|
||||
0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64,
|
||||
0x65, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65,
|
||||
0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10,
|
||||
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79,
|
||||
0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x42, 0x08,
|
||||
0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_dependencies_service_v2_request_proto_rawDescOnce sync.Once
|
||||
file_entity_dependencies_service_v2_request_proto_rawDescData = file_entity_dependencies_service_v2_request_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_dependencies_service_v2_request_proto_rawDescGZIP() []byte {
|
||||
file_entity_dependencies_service_v2_request_proto_rawDescOnce.Do(func() {
|
||||
file_entity_dependencies_service_v2_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_dependencies_service_v2_request_proto_rawDescData)
|
||||
})
|
||||
return file_entity_dependencies_service_v2_request_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_dependencies_service_v2_request_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_entity_dependencies_service_v2_request_proto_goTypes = []interface{}{
|
||||
(*Dependency)(nil), // 0: grpc.Dependency
|
||||
(*DependenciesServiceV2ConnectRequest)(nil), // 1: grpc.DependenciesServiceV2ConnectRequest
|
||||
(*DependenciesServiceV2SyncRequest)(nil), // 2: grpc.DependenciesServiceV2SyncRequest
|
||||
(*DependenciesServiceV2InstallRequest)(nil), // 3: grpc.DependenciesServiceV2InstallRequest
|
||||
(*DependenciesServiceV2UninstallRequest)(nil), // 4: grpc.DependenciesServiceV2UninstallRequest
|
||||
}
|
||||
var file_entity_dependencies_service_v2_request_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.DependenciesServiceV2SyncRequest.dependencies:type_name -> grpc.Dependency
|
||||
0, // 1: grpc.DependenciesServiceV2InstallRequest.dependencies:type_name -> grpc.Dependency
|
||||
0, // 2: grpc.DependenciesServiceV2UninstallRequest.dependencies:type_name -> grpc.Dependency
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_entity_dependencies_service_v2_request_proto_init() }
|
||||
func file_entity_dependencies_service_v2_request_proto_init() {
|
||||
if File_entity_dependencies_service_v2_request_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entity_dependencies_service_v2_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Dependency); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entity_dependencies_service_v2_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DependenciesServiceV2ConnectRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entity_dependencies_service_v2_request_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DependenciesServiceV2SyncRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entity_dependencies_service_v2_request_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DependenciesServiceV2InstallRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entity_dependencies_service_v2_request_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DependenciesServiceV2UninstallRequest); 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_entity_dependencies_service_v2_request_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_dependencies_service_v2_request_proto_goTypes,
|
||||
DependencyIndexes: file_entity_dependencies_service_v2_request_proto_depIdxs,
|
||||
MessageInfos: file_entity_dependencies_service_v2_request_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entity_dependencies_service_v2_request_proto = out.File
|
||||
file_entity_dependencies_service_v2_request_proto_rawDesc = nil
|
||||
file_entity_dependencies_service_v2_request_proto_goTypes = nil
|
||||
file_entity_dependencies_service_v2_request_proto_depIdxs = nil
|
||||
}
|
||||
108
grpc/dependency_service_v2.pb.go
Normal file
108
grpc/dependency_service_v2.pb.go
Normal file
@@ -0,0 +1,108 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/dependency_service_v2.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_dependency_service_v2_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_dependency_service_v2_proto_rawDesc = []byte{
|
||||
0x0a, 0x24, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e,
|
||||
0x64, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x2c, 0x65, 0x6e,
|
||||
0x74, 0x69, 0x74, 0x79, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65,
|
||||
0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32, 0x5f, 0x72, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69,
|
||||
0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x32, 0xc9, 0x02, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x12, 0x48, 0x0a, 0x07, 0x43, 0x6f, 0x6e,
|
||||
0x6e, 0x65, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65,
|
||||
0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56,
|
||||
0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x28, 0x01, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x26, 0x2e, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c,
|
||||
0x12, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e,
|
||||
0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x49, 0x6e, 0x73,
|
||||
0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30,
|
||||
0x01, 0x12, 0x5a, 0x0a, 0x15, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x65,
|
||||
0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x08, 0x5a,
|
||||
0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_dependency_service_v2_proto_goTypes = []interface{}{
|
||||
(*DependenciesServiceV2ConnectRequest)(nil), // 0: grpc.DependenciesServiceV2ConnectRequest
|
||||
(*DependenciesServiceV2SyncRequest)(nil), // 1: grpc.DependenciesServiceV2SyncRequest
|
||||
(*DependenciesServiceV2InstallRequest)(nil), // 2: grpc.DependenciesServiceV2InstallRequest
|
||||
(*DependenciesServiceV2UninstallRequest)(nil), // 3: grpc.DependenciesServiceV2UninstallRequest
|
||||
(*Response)(nil), // 4: grpc.Response
|
||||
}
|
||||
var file_services_dependency_service_v2_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.DependencyServiceV2.Connect:input_type -> grpc.DependenciesServiceV2ConnectRequest
|
||||
1, // 1: grpc.DependencyServiceV2.Sync:input_type -> grpc.DependenciesServiceV2SyncRequest
|
||||
2, // 2: grpc.DependencyServiceV2.Install:input_type -> grpc.DependenciesServiceV2InstallRequest
|
||||
3, // 3: grpc.DependencyServiceV2.UninstallDependencies:input_type -> grpc.DependenciesServiceV2UninstallRequest
|
||||
4, // 4: grpc.DependencyServiceV2.Connect:output_type -> grpc.Response
|
||||
4, // 5: grpc.DependencyServiceV2.Sync:output_type -> grpc.Response
|
||||
4, // 6: grpc.DependencyServiceV2.Install:output_type -> grpc.Response
|
||||
4, // 7: grpc.DependencyServiceV2.UninstallDependencies:output_type -> grpc.Response
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] 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_services_dependency_service_v2_proto_init() }
|
||||
func file_services_dependency_service_v2_proto_init() {
|
||||
if File_services_dependency_service_v2_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_dependencies_service_v2_request_proto_init()
|
||||
file_entity_response_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_dependency_service_v2_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_dependency_service_v2_proto_goTypes,
|
||||
DependencyIndexes: file_services_dependency_service_v2_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_dependency_service_v2_proto = out.File
|
||||
file_services_dependency_service_v2_proto_rawDesc = nil
|
||||
file_services_dependency_service_v2_proto_goTypes = nil
|
||||
file_services_dependency_service_v2_proto_depIdxs = nil
|
||||
}
|
||||
312
grpc/dependency_service_v2_grpc.pb.go
Normal file
312
grpc/dependency_service_v2_grpc.pb.go
Normal file
@@ -0,0 +1,312 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/dependency_service_v2.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// DependencyServiceV2Client is the client API for DependencyServiceV2 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 DependencyServiceV2Client interface {
|
||||
Connect(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_ConnectClient, error)
|
||||
Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Install(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_InstallClient, error)
|
||||
UninstallDependencies(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_UninstallDependenciesClient, error)
|
||||
}
|
||||
|
||||
type dependencyServiceV2Client struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDependencyServiceV2Client(cc grpc.ClientConnInterface) DependencyServiceV2Client {
|
||||
return &dependencyServiceV2Client{cc}
|
||||
}
|
||||
|
||||
func (c *dependencyServiceV2Client) Connect(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_ConnectClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[0], "/grpc.DependencyServiceV2/Connect", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &dependencyServiceV2ConnectClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type DependencyServiceV2_ConnectClient interface {
|
||||
Send(*DependenciesServiceV2ConnectRequest) error
|
||||
CloseAndRecv() (*Response, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type dependencyServiceV2ConnectClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2ConnectClient) Send(m *DependenciesServiceV2ConnectRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2ConnectClient) 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
|
||||
}
|
||||
|
||||
func (c *dependencyServiceV2Client) Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.DependencyServiceV2/Sync", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dependencyServiceV2Client) Install(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_InstallClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[1], "/grpc.DependencyServiceV2/Install", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &dependencyServiceV2InstallClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type DependencyServiceV2_InstallClient interface {
|
||||
Send(*DependenciesServiceV2InstallRequest) error
|
||||
Recv() (*Response, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type dependencyServiceV2InstallClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2InstallClient) Send(m *DependenciesServiceV2InstallRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2InstallClient) Recv() (*Response, error) {
|
||||
m := new(Response)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *dependencyServiceV2Client) UninstallDependencies(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_UninstallDependenciesClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[2], "/grpc.DependencyServiceV2/UninstallDependencies", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &dependencyServiceV2UninstallDependenciesClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type DependencyServiceV2_UninstallDependenciesClient interface {
|
||||
Send(*DependenciesServiceV2UninstallRequest) error
|
||||
Recv() (*Response, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type dependencyServiceV2UninstallDependenciesClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2UninstallDependenciesClient) Send(m *DependenciesServiceV2UninstallRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2UninstallDependenciesClient) Recv() (*Response, error) {
|
||||
m := new(Response)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// DependencyServiceV2Server is the server API for DependencyServiceV2 service.
|
||||
// All implementations must embed UnimplementedDependencyServiceV2Server
|
||||
// for forward compatibility
|
||||
type DependencyServiceV2Server interface {
|
||||
Connect(DependencyServiceV2_ConnectServer) error
|
||||
Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error)
|
||||
Install(DependencyServiceV2_InstallServer) error
|
||||
UninstallDependencies(DependencyServiceV2_UninstallDependenciesServer) error
|
||||
mustEmbedUnimplementedDependencyServiceV2Server()
|
||||
}
|
||||
|
||||
// UnimplementedDependencyServiceV2Server must be embedded to have forward compatible implementations.
|
||||
type UnimplementedDependencyServiceV2Server struct {
|
||||
}
|
||||
|
||||
func (UnimplementedDependencyServiceV2Server) Connect(DependencyServiceV2_ConnectServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Connect not implemented")
|
||||
}
|
||||
func (UnimplementedDependencyServiceV2Server) Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
|
||||
}
|
||||
func (UnimplementedDependencyServiceV2Server) Install(DependencyServiceV2_InstallServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Install not implemented")
|
||||
}
|
||||
func (UnimplementedDependencyServiceV2Server) UninstallDependencies(DependencyServiceV2_UninstallDependenciesServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method UninstallDependencies not implemented")
|
||||
}
|
||||
func (UnimplementedDependencyServiceV2Server) mustEmbedUnimplementedDependencyServiceV2Server() {}
|
||||
|
||||
// UnsafeDependencyServiceV2Server may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DependencyServiceV2Server will
|
||||
// result in compilation errors.
|
||||
type UnsafeDependencyServiceV2Server interface {
|
||||
mustEmbedUnimplementedDependencyServiceV2Server()
|
||||
}
|
||||
|
||||
func RegisterDependencyServiceV2Server(s grpc.ServiceRegistrar, srv DependencyServiceV2Server) {
|
||||
s.RegisterService(&DependencyServiceV2_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DependencyServiceV2_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(DependencyServiceV2Server).Connect(&dependencyServiceV2ConnectServer{stream})
|
||||
}
|
||||
|
||||
type DependencyServiceV2_ConnectServer interface {
|
||||
SendAndClose(*Response) error
|
||||
Recv() (*DependenciesServiceV2ConnectRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type dependencyServiceV2ConnectServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2ConnectServer) SendAndClose(m *Response) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2ConnectServer) Recv() (*DependenciesServiceV2ConnectRequest, error) {
|
||||
m := new(DependenciesServiceV2ConnectRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _DependencyServiceV2_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DependenciesServiceV2SyncRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DependencyServiceV2Server).Sync(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.DependencyServiceV2/Sync",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DependencyServiceV2Server).Sync(ctx, req.(*DependenciesServiceV2SyncRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DependencyServiceV2_Install_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(DependencyServiceV2Server).Install(&dependencyServiceV2InstallServer{stream})
|
||||
}
|
||||
|
||||
type DependencyServiceV2_InstallServer interface {
|
||||
Send(*Response) error
|
||||
Recv() (*DependenciesServiceV2InstallRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type dependencyServiceV2InstallServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2InstallServer) Send(m *Response) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2InstallServer) Recv() (*DependenciesServiceV2InstallRequest, error) {
|
||||
m := new(DependenciesServiceV2InstallRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _DependencyServiceV2_UninstallDependencies_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(DependencyServiceV2Server).UninstallDependencies(&dependencyServiceV2UninstallDependenciesServer{stream})
|
||||
}
|
||||
|
||||
type DependencyServiceV2_UninstallDependenciesServer interface {
|
||||
Send(*Response) error
|
||||
Recv() (*DependenciesServiceV2UninstallRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type dependencyServiceV2UninstallDependenciesServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2UninstallDependenciesServer) Send(m *Response) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *dependencyServiceV2UninstallDependenciesServer) Recv() (*DependenciesServiceV2UninstallRequest, error) {
|
||||
m := new(DependenciesServiceV2UninstallRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// DependencyServiceV2_ServiceDesc is the grpc.ServiceDesc for DependencyServiceV2 service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DependencyServiceV2_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.DependencyServiceV2",
|
||||
HandlerType: (*DependencyServiceV2Server)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Sync",
|
||||
Handler: _DependencyServiceV2_Sync_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Connect",
|
||||
Handler: _DependencyServiceV2_Connect_Handler,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "Install",
|
||||
Handler: _DependencyServiceV2_Install_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "UninstallDependencies",
|
||||
Handler: _DependencyServiceV2_UninstallDependencies_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "services/dependency_service_v2.proto",
|
||||
}
|
||||
16
grpc/go.mod
Normal file
16
grpc/go.mod
Normal file
@@ -0,0 +1,16 @@
|
||||
module github.com/crawlab-team/crawlab/grpc
|
||||
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
github.com/golang/protobuf v1.5.4
|
||||
google.golang.org/grpc v1.64.0
|
||||
google.golang.org/protobuf v1.34.1
|
||||
)
|
||||
|
||||
require (
|
||||
golang.org/x/net v0.22.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
|
||||
)
|
||||
16
grpc/go.sum
Normal file
16
grpc/go.sum
Normal file
@@ -0,0 +1,16 @@
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
|
||||
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
|
||||
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
|
||||
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
|
||||
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
79
grpc/message_service.pb.go
Normal file
79
grpc/message_service.pb.go
Normal file
@@ -0,0 +1,79 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/message_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_message_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_message_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x73,
|
||||
0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x32, 0x4b, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
|
||||
0x12, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65,
|
||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72,
|
||||
0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01,
|
||||
0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_message_service_proto_goTypes = []interface{}{
|
||||
(*StreamMessage)(nil), // 0: grpc.StreamMessage
|
||||
}
|
||||
var file_services_message_service_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.MessageService.Connect:input_type -> grpc.StreamMessage
|
||||
0, // 1: grpc.MessageService.Connect:output_type -> grpc.StreamMessage
|
||||
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_services_message_service_proto_init() }
|
||||
func file_services_message_service_proto_init() {
|
||||
if File_services_message_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_stream_message_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_message_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_message_service_proto_goTypes,
|
||||
DependencyIndexes: file_services_message_service_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_message_service_proto = out.File
|
||||
file_services_message_service_proto_rawDesc = nil
|
||||
file_services_message_service_proto_goTypes = nil
|
||||
file_services_message_service_proto_depIdxs = nil
|
||||
}
|
||||
137
grpc/message_service_grpc.pb.go
Normal file
137
grpc/message_service_grpc.pb.go
Normal file
@@ -0,0 +1,137 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/message_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// MessageServiceClient is the client API for MessageService 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 MessageServiceClient interface {
|
||||
Connect(ctx context.Context, opts ...grpc.CallOption) (MessageService_ConnectClient, error)
|
||||
}
|
||||
|
||||
type messageServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMessageServiceClient(cc grpc.ClientConnInterface) MessageServiceClient {
|
||||
return &messageServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *messageServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (MessageService_ConnectClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &MessageService_ServiceDesc.Streams[0], "/grpc.MessageService/Connect", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &messageServiceConnectClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type MessageService_ConnectClient interface {
|
||||
Send(*StreamMessage) error
|
||||
Recv() (*StreamMessage, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type messageServiceConnectClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *messageServiceConnectClient) Send(m *StreamMessage) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *messageServiceConnectClient) Recv() (*StreamMessage, error) {
|
||||
m := new(StreamMessage)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// MessageServiceServer is the server API for MessageService service.
|
||||
// All implementations must embed UnimplementedMessageServiceServer
|
||||
// for forward compatibility
|
||||
type MessageServiceServer interface {
|
||||
Connect(MessageService_ConnectServer) error
|
||||
mustEmbedUnimplementedMessageServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedMessageServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedMessageServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedMessageServiceServer) Connect(MessageService_ConnectServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Connect not implemented")
|
||||
}
|
||||
func (UnimplementedMessageServiceServer) mustEmbedUnimplementedMessageServiceServer() {}
|
||||
|
||||
// UnsafeMessageServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MessageServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMessageServiceServer interface {
|
||||
mustEmbedUnimplementedMessageServiceServer()
|
||||
}
|
||||
|
||||
func RegisterMessageServiceServer(s grpc.ServiceRegistrar, srv MessageServiceServer) {
|
||||
s.RegisterService(&MessageService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _MessageService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(MessageServiceServer).Connect(&messageServiceConnectServer{stream})
|
||||
}
|
||||
|
||||
type MessageService_ConnectServer interface {
|
||||
Send(*StreamMessage) error
|
||||
Recv() (*StreamMessage, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type messageServiceConnectServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *messageServiceConnectServer) Send(m *StreamMessage) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *messageServiceConnectServer) Recv() (*StreamMessage, error) {
|
||||
m := new(StreamMessage)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// MessageService_ServiceDesc is the grpc.ServiceDesc for MessageService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var MessageService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.MessageService",
|
||||
HandlerType: (*MessageServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Connect",
|
||||
Handler: _MessageService_Connect_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "services/message_service.proto",
|
||||
}
|
||||
134
grpc/model_base_service.pb.go
Normal file
134
grpc/model_base_service.pb.go
Normal file
@@ -0,0 +1,134 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/model_base_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_model_base_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_model_base_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x14, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
||||
0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xac, 0x04, 0x0a, 0x10, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x42, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x47,
|
||||
0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x26, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x0d,
|
||||
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
|
||||
0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x2a, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x0a, 0x44,
|
||||
0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x29, 0x0a, 0x06, 0x44, 0x65,
|
||||
0x6c, 0x65, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c,
|
||||
0x65, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x42, 0x79, 0x49, 0x64, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x29, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74,
|
||||
0x65, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x2c, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x12,
|
||||
0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e,
|
||||
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x12, 0x29, 0x0a, 0x06, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x05, 0x43,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_model_base_service_proto_goTypes = []interface{}{
|
||||
(*Request)(nil), // 0: grpc.Request
|
||||
(*Response)(nil), // 1: grpc.Response
|
||||
}
|
||||
var file_services_model_base_service_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.ModelBaseService.GetById:input_type -> grpc.Request
|
||||
0, // 1: grpc.ModelBaseService.Get:input_type -> grpc.Request
|
||||
0, // 2: grpc.ModelBaseService.GetList:input_type -> grpc.Request
|
||||
0, // 3: grpc.ModelBaseService.DeleteById:input_type -> grpc.Request
|
||||
0, // 4: grpc.ModelBaseService.Delete:input_type -> grpc.Request
|
||||
0, // 5: grpc.ModelBaseService.DeleteList:input_type -> grpc.Request
|
||||
0, // 6: grpc.ModelBaseService.ForceDeleteList:input_type -> grpc.Request
|
||||
0, // 7: grpc.ModelBaseService.UpdateById:input_type -> grpc.Request
|
||||
0, // 8: grpc.ModelBaseService.Update:input_type -> grpc.Request
|
||||
0, // 9: grpc.ModelBaseService.UpdateDoc:input_type -> grpc.Request
|
||||
0, // 10: grpc.ModelBaseService.Insert:input_type -> grpc.Request
|
||||
0, // 11: grpc.ModelBaseService.Count:input_type -> grpc.Request
|
||||
1, // 12: grpc.ModelBaseService.GetById:output_type -> grpc.Response
|
||||
1, // 13: grpc.ModelBaseService.Get:output_type -> grpc.Response
|
||||
1, // 14: grpc.ModelBaseService.GetList:output_type -> grpc.Response
|
||||
1, // 15: grpc.ModelBaseService.DeleteById:output_type -> grpc.Response
|
||||
1, // 16: grpc.ModelBaseService.Delete:output_type -> grpc.Response
|
||||
1, // 17: grpc.ModelBaseService.DeleteList:output_type -> grpc.Response
|
||||
1, // 18: grpc.ModelBaseService.ForceDeleteList:output_type -> grpc.Response
|
||||
1, // 19: grpc.ModelBaseService.UpdateById:output_type -> grpc.Response
|
||||
1, // 20: grpc.ModelBaseService.Update:output_type -> grpc.Response
|
||||
1, // 21: grpc.ModelBaseService.UpdateDoc:output_type -> grpc.Response
|
||||
1, // 22: grpc.ModelBaseService.Insert:output_type -> grpc.Response
|
||||
1, // 23: grpc.ModelBaseService.Count:output_type -> grpc.Response
|
||||
12, // [12:24] is the sub-list for method output_type
|
||||
0, // [0:12] 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_services_model_base_service_proto_init() }
|
||||
func file_services_model_base_service_proto_init() {
|
||||
if File_services_model_base_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_request_proto_init()
|
||||
file_entity_response_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_model_base_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_model_base_service_proto_goTypes,
|
||||
DependencyIndexes: file_services_model_base_service_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_model_base_service_proto = out.File
|
||||
file_services_model_base_service_proto_rawDesc = nil
|
||||
file_services_model_base_service_proto_goTypes = nil
|
||||
file_services_model_base_service_proto_depIdxs = nil
|
||||
}
|
||||
501
grpc/model_base_service_grpc.pb.go
Normal file
501
grpc/model_base_service_grpc.pb.go
Normal file
@@ -0,0 +1,501 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/model_base_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// ModelBaseServiceClient is the client API for ModelBaseService 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 ModelBaseServiceClient interface {
|
||||
GetById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
Get(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
GetList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
DeleteById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
Delete(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
DeleteList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
ForceDeleteList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
UpdateById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
Update(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
UpdateDoc(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
Insert(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
Count(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type modelBaseServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewModelBaseServiceClient(cc grpc.ClientConnInterface) ModelBaseServiceClient {
|
||||
return &modelBaseServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) GetById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/GetById", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) Get(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/Get", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) GetList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/GetList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) DeleteById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/DeleteById", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) Delete(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/Delete", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) DeleteList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/DeleteList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) ForceDeleteList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/ForceDeleteList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) UpdateById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/UpdateById", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) Update(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/Update", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) UpdateDoc(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/UpdateDoc", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) Insert(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/Insert", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceClient) Count(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseService/Count", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ModelBaseServiceServer is the server API for ModelBaseService service.
|
||||
// All implementations must embed UnimplementedModelBaseServiceServer
|
||||
// for forward compatibility
|
||||
type ModelBaseServiceServer interface {
|
||||
GetById(context.Context, *Request) (*Response, error)
|
||||
Get(context.Context, *Request) (*Response, error)
|
||||
GetList(context.Context, *Request) (*Response, error)
|
||||
DeleteById(context.Context, *Request) (*Response, error)
|
||||
Delete(context.Context, *Request) (*Response, error)
|
||||
DeleteList(context.Context, *Request) (*Response, error)
|
||||
ForceDeleteList(context.Context, *Request) (*Response, error)
|
||||
UpdateById(context.Context, *Request) (*Response, error)
|
||||
Update(context.Context, *Request) (*Response, error)
|
||||
UpdateDoc(context.Context, *Request) (*Response, error)
|
||||
Insert(context.Context, *Request) (*Response, error)
|
||||
Count(context.Context, *Request) (*Response, error)
|
||||
mustEmbedUnimplementedModelBaseServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedModelBaseServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedModelBaseServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedModelBaseServiceServer) GetById(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetById not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) Get(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) GetList(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetList not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) DeleteById(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteById not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) Delete(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) DeleteList(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteList not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) ForceDeleteList(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ForceDeleteList not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) UpdateById(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateById not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) Update(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) UpdateDoc(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateDoc not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) Insert(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Insert not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) Count(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Count not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceServer) mustEmbedUnimplementedModelBaseServiceServer() {}
|
||||
|
||||
// UnsafeModelBaseServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ModelBaseServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeModelBaseServiceServer interface {
|
||||
mustEmbedUnimplementedModelBaseServiceServer()
|
||||
}
|
||||
|
||||
func RegisterModelBaseServiceServer(s grpc.ServiceRegistrar, srv ModelBaseServiceServer) {
|
||||
s.RegisterService(&ModelBaseService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ModelBaseService_GetById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).GetById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/GetById",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).GetById(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).Get(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/Get",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).Get(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_GetList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).GetList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/GetList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).GetList(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_DeleteById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).DeleteById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/DeleteById",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).DeleteById(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).Delete(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/Delete",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).Delete(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_DeleteList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).DeleteList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/DeleteList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).DeleteList(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_ForceDeleteList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).ForceDeleteList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/ForceDeleteList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).ForceDeleteList(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_UpdateById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).UpdateById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/UpdateById",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).UpdateById(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).Update(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/Update",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).Update(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_UpdateDoc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).UpdateDoc(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/UpdateDoc",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).UpdateDoc(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_Insert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).Insert(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/Insert",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).Insert(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseService_Count_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceServer).Count(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseService/Count",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceServer).Count(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ModelBaseService_ServiceDesc is the grpc.ServiceDesc for ModelBaseService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ModelBaseService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.ModelBaseService",
|
||||
HandlerType: (*ModelBaseServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetById",
|
||||
Handler: _ModelBaseService_GetById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Get",
|
||||
Handler: _ModelBaseService_Get_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetList",
|
||||
Handler: _ModelBaseService_GetList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteById",
|
||||
Handler: _ModelBaseService_DeleteById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Delete",
|
||||
Handler: _ModelBaseService_Delete_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteList",
|
||||
Handler: _ModelBaseService_DeleteList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ForceDeleteList",
|
||||
Handler: _ModelBaseService_ForceDeleteList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateById",
|
||||
Handler: _ModelBaseService_UpdateById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Update",
|
||||
Handler: _ModelBaseService_Update_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateDoc",
|
||||
Handler: _ModelBaseService_UpdateDoc_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Insert",
|
||||
Handler: _ModelBaseService_Insert_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Count",
|
||||
Handler: _ModelBaseService_Count_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "services/model_base_service.proto",
|
||||
}
|
||||
179
grpc/model_base_service_v2.pb.go
Normal file
179
grpc/model_base_service_v2.pb.go
Normal file
@@ -0,0 +1,179 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/model_base_service_v2.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_model_base_service_v2_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_model_base_service_v2_proto_rawDesc = []byte{
|
||||
0x0a, 0x24, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x25, 0x65, 0x6e,
|
||||
0x74, 0x69, 0x74, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x5f, 0x76, 0x32, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xd4, 0x07, 0x0a, 0x12, 0x4d,
|
||||
0x6f, 0x64, 0x65, 0x6c, 0x42, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56,
|
||||
0x32, 0x12, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x22, 0x2e, 0x67,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x56, 0x32, 0x47, 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x3d, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x65, 0x12, 0x21, 0x2e, 0x67,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x56, 0x32, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x22, 0x2e, 0x67,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x56, 0x32, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64,
|
||||
0x12, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x09, 0x44, 0x65, 0x6c,
|
||||
0x65, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f,
|
||||
0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x44, 0x65, 0x6c, 0x65,
|
||||
0x74, 0x65, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45,
|
||||
0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x25, 0x2e, 0x67,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x56, 0x32, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42,
|
||||
0x79, 0x49, 0x64, 0x12, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42,
|
||||
0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x09,
|
||||
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x45, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x12,
|
||||
0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0b, 0x52, 0x65, 0x70, 0x6c,
|
||||
0x61, 0x63, 0x65, 0x42, 0x79, 0x49, 0x64, 0x12, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d,
|
||||
0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x52, 0x65, 0x70,
|
||||
0x6c, 0x61, 0x63, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x45, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x6e, 0x65, 0x12,
|
||||
0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x56, 0x32, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x6e, 0x65, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x09, 0x49, 0x6e, 0x73, 0x65,
|
||||
0x72, 0x74, 0x4f, 0x6e, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64,
|
||||
0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x49, 0x6e, 0x73, 0x65, 0x72,
|
||||
0x74, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a,
|
||||
0x0a, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x25, 0x2e, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56,
|
||||
0x32, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e,
|
||||
0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x56, 0x32, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_model_base_service_v2_proto_goTypes = []interface{}{
|
||||
(*ModelServiceV2GetByIdRequest)(nil), // 0: grpc.ModelServiceV2GetByIdRequest
|
||||
(*ModelServiceV2GetOneRequest)(nil), // 1: grpc.ModelServiceV2GetOneRequest
|
||||
(*ModelServiceV2GetManyRequest)(nil), // 2: grpc.ModelServiceV2GetManyRequest
|
||||
(*ModelServiceV2DeleteByIdRequest)(nil), // 3: grpc.ModelServiceV2DeleteByIdRequest
|
||||
(*ModelServiceV2DeleteOneRequest)(nil), // 4: grpc.ModelServiceV2DeleteOneRequest
|
||||
(*ModelServiceV2DeleteManyRequest)(nil), // 5: grpc.ModelServiceV2DeleteManyRequest
|
||||
(*ModelServiceV2UpdateByIdRequest)(nil), // 6: grpc.ModelServiceV2UpdateByIdRequest
|
||||
(*ModelServiceV2UpdateOneRequest)(nil), // 7: grpc.ModelServiceV2UpdateOneRequest
|
||||
(*ModelServiceV2UpdateManyRequest)(nil), // 8: grpc.ModelServiceV2UpdateManyRequest
|
||||
(*ModelServiceV2ReplaceByIdRequest)(nil), // 9: grpc.ModelServiceV2ReplaceByIdRequest
|
||||
(*ModelServiceV2ReplaceOneRequest)(nil), // 10: grpc.ModelServiceV2ReplaceOneRequest
|
||||
(*ModelServiceV2InsertOneRequest)(nil), // 11: grpc.ModelServiceV2InsertOneRequest
|
||||
(*ModelServiceV2InsertManyRequest)(nil), // 12: grpc.ModelServiceV2InsertManyRequest
|
||||
(*ModelServiceV2CountRequest)(nil), // 13: grpc.ModelServiceV2CountRequest
|
||||
(*Response)(nil), // 14: grpc.Response
|
||||
}
|
||||
var file_services_model_base_service_v2_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.ModelBaseServiceV2.GetById:input_type -> grpc.ModelServiceV2GetByIdRequest
|
||||
1, // 1: grpc.ModelBaseServiceV2.GetOne:input_type -> grpc.ModelServiceV2GetOneRequest
|
||||
2, // 2: grpc.ModelBaseServiceV2.GetMany:input_type -> grpc.ModelServiceV2GetManyRequest
|
||||
3, // 3: grpc.ModelBaseServiceV2.DeleteById:input_type -> grpc.ModelServiceV2DeleteByIdRequest
|
||||
4, // 4: grpc.ModelBaseServiceV2.DeleteOne:input_type -> grpc.ModelServiceV2DeleteOneRequest
|
||||
5, // 5: grpc.ModelBaseServiceV2.DeleteMany:input_type -> grpc.ModelServiceV2DeleteManyRequest
|
||||
6, // 6: grpc.ModelBaseServiceV2.UpdateById:input_type -> grpc.ModelServiceV2UpdateByIdRequest
|
||||
7, // 7: grpc.ModelBaseServiceV2.UpdateOne:input_type -> grpc.ModelServiceV2UpdateOneRequest
|
||||
8, // 8: grpc.ModelBaseServiceV2.UpdateMany:input_type -> grpc.ModelServiceV2UpdateManyRequest
|
||||
9, // 9: grpc.ModelBaseServiceV2.ReplaceById:input_type -> grpc.ModelServiceV2ReplaceByIdRequest
|
||||
10, // 10: grpc.ModelBaseServiceV2.ReplaceOne:input_type -> grpc.ModelServiceV2ReplaceOneRequest
|
||||
11, // 11: grpc.ModelBaseServiceV2.InsertOne:input_type -> grpc.ModelServiceV2InsertOneRequest
|
||||
12, // 12: grpc.ModelBaseServiceV2.InsertMany:input_type -> grpc.ModelServiceV2InsertManyRequest
|
||||
13, // 13: grpc.ModelBaseServiceV2.Count:input_type -> grpc.ModelServiceV2CountRequest
|
||||
14, // 14: grpc.ModelBaseServiceV2.GetById:output_type -> grpc.Response
|
||||
14, // 15: grpc.ModelBaseServiceV2.GetOne:output_type -> grpc.Response
|
||||
14, // 16: grpc.ModelBaseServiceV2.GetMany:output_type -> grpc.Response
|
||||
14, // 17: grpc.ModelBaseServiceV2.DeleteById:output_type -> grpc.Response
|
||||
14, // 18: grpc.ModelBaseServiceV2.DeleteOne:output_type -> grpc.Response
|
||||
14, // 19: grpc.ModelBaseServiceV2.DeleteMany:output_type -> grpc.Response
|
||||
14, // 20: grpc.ModelBaseServiceV2.UpdateById:output_type -> grpc.Response
|
||||
14, // 21: grpc.ModelBaseServiceV2.UpdateOne:output_type -> grpc.Response
|
||||
14, // 22: grpc.ModelBaseServiceV2.UpdateMany:output_type -> grpc.Response
|
||||
14, // 23: grpc.ModelBaseServiceV2.ReplaceById:output_type -> grpc.Response
|
||||
14, // 24: grpc.ModelBaseServiceV2.ReplaceOne:output_type -> grpc.Response
|
||||
14, // 25: grpc.ModelBaseServiceV2.InsertOne:output_type -> grpc.Response
|
||||
14, // 26: grpc.ModelBaseServiceV2.InsertMany:output_type -> grpc.Response
|
||||
14, // 27: grpc.ModelBaseServiceV2.Count:output_type -> grpc.Response
|
||||
14, // [14:28] is the sub-list for method output_type
|
||||
0, // [0:14] 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_services_model_base_service_v2_proto_init() }
|
||||
func file_services_model_base_service_v2_proto_init() {
|
||||
if File_services_model_base_service_v2_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_model_service_v2_request_proto_init()
|
||||
file_entity_response_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_model_base_service_v2_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_model_base_service_v2_proto_goTypes,
|
||||
DependencyIndexes: file_services_model_base_service_v2_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_model_base_service_v2_proto = out.File
|
||||
file_services_model_base_service_v2_proto_rawDesc = nil
|
||||
file_services_model_base_service_v2_proto_goTypes = nil
|
||||
file_services_model_base_service_v2_proto_depIdxs = nil
|
||||
}
|
||||
573
grpc/model_base_service_v2_grpc.pb.go
Normal file
573
grpc/model_base_service_v2_grpc.pb.go
Normal file
@@ -0,0 +1,573 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/model_base_service_v2.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// ModelBaseServiceV2Client is the client API for ModelBaseServiceV2 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 ModelBaseServiceV2Client interface {
|
||||
GetById(ctx context.Context, in *ModelServiceV2GetByIdRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
GetOne(ctx context.Context, in *ModelServiceV2GetOneRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
GetMany(ctx context.Context, in *ModelServiceV2GetManyRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
DeleteById(ctx context.Context, in *ModelServiceV2DeleteByIdRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
DeleteOne(ctx context.Context, in *ModelServiceV2DeleteOneRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
DeleteMany(ctx context.Context, in *ModelServiceV2DeleteManyRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
UpdateById(ctx context.Context, in *ModelServiceV2UpdateByIdRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
UpdateOne(ctx context.Context, in *ModelServiceV2UpdateOneRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
UpdateMany(ctx context.Context, in *ModelServiceV2UpdateManyRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
ReplaceById(ctx context.Context, in *ModelServiceV2ReplaceByIdRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
ReplaceOne(ctx context.Context, in *ModelServiceV2ReplaceOneRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
InsertOne(ctx context.Context, in *ModelServiceV2InsertOneRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
InsertMany(ctx context.Context, in *ModelServiceV2InsertManyRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Count(ctx context.Context, in *ModelServiceV2CountRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type modelBaseServiceV2Client struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewModelBaseServiceV2Client(cc grpc.ClientConnInterface) ModelBaseServiceV2Client {
|
||||
return &modelBaseServiceV2Client{cc}
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) GetById(ctx context.Context, in *ModelServiceV2GetByIdRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/GetById", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) GetOne(ctx context.Context, in *ModelServiceV2GetOneRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/GetOne", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) GetMany(ctx context.Context, in *ModelServiceV2GetManyRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/GetMany", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) DeleteById(ctx context.Context, in *ModelServiceV2DeleteByIdRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/DeleteById", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) DeleteOne(ctx context.Context, in *ModelServiceV2DeleteOneRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/DeleteOne", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) DeleteMany(ctx context.Context, in *ModelServiceV2DeleteManyRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/DeleteMany", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) UpdateById(ctx context.Context, in *ModelServiceV2UpdateByIdRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/UpdateById", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) UpdateOne(ctx context.Context, in *ModelServiceV2UpdateOneRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/UpdateOne", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) UpdateMany(ctx context.Context, in *ModelServiceV2UpdateManyRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/UpdateMany", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) ReplaceById(ctx context.Context, in *ModelServiceV2ReplaceByIdRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/ReplaceById", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) ReplaceOne(ctx context.Context, in *ModelServiceV2ReplaceOneRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/ReplaceOne", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) InsertOne(ctx context.Context, in *ModelServiceV2InsertOneRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/InsertOne", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) InsertMany(ctx context.Context, in *ModelServiceV2InsertManyRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/InsertMany", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *modelBaseServiceV2Client) Count(ctx context.Context, in *ModelServiceV2CountRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelBaseServiceV2/Count", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ModelBaseServiceV2Server is the server API for ModelBaseServiceV2 service.
|
||||
// All implementations must embed UnimplementedModelBaseServiceV2Server
|
||||
// for forward compatibility
|
||||
type ModelBaseServiceV2Server interface {
|
||||
GetById(context.Context, *ModelServiceV2GetByIdRequest) (*Response, error)
|
||||
GetOne(context.Context, *ModelServiceV2GetOneRequest) (*Response, error)
|
||||
GetMany(context.Context, *ModelServiceV2GetManyRequest) (*Response, error)
|
||||
DeleteById(context.Context, *ModelServiceV2DeleteByIdRequest) (*Response, error)
|
||||
DeleteOne(context.Context, *ModelServiceV2DeleteOneRequest) (*Response, error)
|
||||
DeleteMany(context.Context, *ModelServiceV2DeleteManyRequest) (*Response, error)
|
||||
UpdateById(context.Context, *ModelServiceV2UpdateByIdRequest) (*Response, error)
|
||||
UpdateOne(context.Context, *ModelServiceV2UpdateOneRequest) (*Response, error)
|
||||
UpdateMany(context.Context, *ModelServiceV2UpdateManyRequest) (*Response, error)
|
||||
ReplaceById(context.Context, *ModelServiceV2ReplaceByIdRequest) (*Response, error)
|
||||
ReplaceOne(context.Context, *ModelServiceV2ReplaceOneRequest) (*Response, error)
|
||||
InsertOne(context.Context, *ModelServiceV2InsertOneRequest) (*Response, error)
|
||||
InsertMany(context.Context, *ModelServiceV2InsertManyRequest) (*Response, error)
|
||||
Count(context.Context, *ModelServiceV2CountRequest) (*Response, error)
|
||||
mustEmbedUnimplementedModelBaseServiceV2Server()
|
||||
}
|
||||
|
||||
// UnimplementedModelBaseServiceV2Server must be embedded to have forward compatible implementations.
|
||||
type UnimplementedModelBaseServiceV2Server struct {
|
||||
}
|
||||
|
||||
func (UnimplementedModelBaseServiceV2Server) GetById(context.Context, *ModelServiceV2GetByIdRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetById not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) GetOne(context.Context, *ModelServiceV2GetOneRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetOne not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) GetMany(context.Context, *ModelServiceV2GetManyRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetMany not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) DeleteById(context.Context, *ModelServiceV2DeleteByIdRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteById not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) DeleteOne(context.Context, *ModelServiceV2DeleteOneRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteOne not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) DeleteMany(context.Context, *ModelServiceV2DeleteManyRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteMany not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) UpdateById(context.Context, *ModelServiceV2UpdateByIdRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateById not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) UpdateOne(context.Context, *ModelServiceV2UpdateOneRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateOne not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) UpdateMany(context.Context, *ModelServiceV2UpdateManyRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateMany not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) ReplaceById(context.Context, *ModelServiceV2ReplaceByIdRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ReplaceById not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) ReplaceOne(context.Context, *ModelServiceV2ReplaceOneRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ReplaceOne not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) InsertOne(context.Context, *ModelServiceV2InsertOneRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InsertOne not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) InsertMany(context.Context, *ModelServiceV2InsertManyRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InsertMany not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) Count(context.Context, *ModelServiceV2CountRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Count not implemented")
|
||||
}
|
||||
func (UnimplementedModelBaseServiceV2Server) mustEmbedUnimplementedModelBaseServiceV2Server() {}
|
||||
|
||||
// UnsafeModelBaseServiceV2Server may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ModelBaseServiceV2Server will
|
||||
// result in compilation errors.
|
||||
type UnsafeModelBaseServiceV2Server interface {
|
||||
mustEmbedUnimplementedModelBaseServiceV2Server()
|
||||
}
|
||||
|
||||
func RegisterModelBaseServiceV2Server(s grpc.ServiceRegistrar, srv ModelBaseServiceV2Server) {
|
||||
s.RegisterService(&ModelBaseServiceV2_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_GetById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2GetByIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).GetById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/GetById",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).GetById(ctx, req.(*ModelServiceV2GetByIdRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_GetOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2GetOneRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).GetOne(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/GetOne",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).GetOne(ctx, req.(*ModelServiceV2GetOneRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_GetMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2GetManyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).GetMany(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/GetMany",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).GetMany(ctx, req.(*ModelServiceV2GetManyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_DeleteById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2DeleteByIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).DeleteById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/DeleteById",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).DeleteById(ctx, req.(*ModelServiceV2DeleteByIdRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_DeleteOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2DeleteOneRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).DeleteOne(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/DeleteOne",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).DeleteOne(ctx, req.(*ModelServiceV2DeleteOneRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_DeleteMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2DeleteManyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).DeleteMany(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/DeleteMany",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).DeleteMany(ctx, req.(*ModelServiceV2DeleteManyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_UpdateById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2UpdateByIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).UpdateById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/UpdateById",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).UpdateById(ctx, req.(*ModelServiceV2UpdateByIdRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_UpdateOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2UpdateOneRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).UpdateOne(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/UpdateOne",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).UpdateOne(ctx, req.(*ModelServiceV2UpdateOneRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_UpdateMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2UpdateManyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).UpdateMany(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/UpdateMany",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).UpdateMany(ctx, req.(*ModelServiceV2UpdateManyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_ReplaceById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2ReplaceByIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).ReplaceById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/ReplaceById",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).ReplaceById(ctx, req.(*ModelServiceV2ReplaceByIdRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_ReplaceOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2ReplaceOneRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).ReplaceOne(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/ReplaceOne",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).ReplaceOne(ctx, req.(*ModelServiceV2ReplaceOneRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_InsertOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2InsertOneRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).InsertOne(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/InsertOne",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).InsertOne(ctx, req.(*ModelServiceV2InsertOneRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_InsertMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2InsertManyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).InsertMany(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/InsertMany",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).InsertMany(ctx, req.(*ModelServiceV2InsertManyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModelBaseServiceV2_Count_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ModelServiceV2CountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelBaseServiceV2Server).Count(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelBaseServiceV2/Count",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelBaseServiceV2Server).Count(ctx, req.(*ModelServiceV2CountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ModelBaseServiceV2_ServiceDesc is the grpc.ServiceDesc for ModelBaseServiceV2 service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ModelBaseServiceV2_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.ModelBaseServiceV2",
|
||||
HandlerType: (*ModelBaseServiceV2Server)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetById",
|
||||
Handler: _ModelBaseServiceV2_GetById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetOne",
|
||||
Handler: _ModelBaseServiceV2_GetOne_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMany",
|
||||
Handler: _ModelBaseServiceV2_GetMany_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteById",
|
||||
Handler: _ModelBaseServiceV2_DeleteById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteOne",
|
||||
Handler: _ModelBaseServiceV2_DeleteOne_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteMany",
|
||||
Handler: _ModelBaseServiceV2_DeleteMany_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateById",
|
||||
Handler: _ModelBaseServiceV2_UpdateById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateOne",
|
||||
Handler: _ModelBaseServiceV2_UpdateOne_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateMany",
|
||||
Handler: _ModelBaseServiceV2_UpdateMany_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ReplaceById",
|
||||
Handler: _ModelBaseServiceV2_ReplaceById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ReplaceOne",
|
||||
Handler: _ModelBaseServiceV2_ReplaceOne_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InsertOne",
|
||||
Handler: _ModelBaseServiceV2_InsertOne_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InsertMany",
|
||||
Handler: _ModelBaseServiceV2_InsertMany_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Count",
|
||||
Handler: _ModelBaseServiceV2_Count_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "services/model_base_service_v2.proto",
|
||||
}
|
||||
80
grpc/model_delegate.pb.go
Normal file
80
grpc/model_delegate.pb.go
Normal file
@@ -0,0 +1,80 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/model_delegate.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_model_delegate_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_model_delegate_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x14, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x65, 0x6e, 0x74,
|
||||
0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x32, 0x36, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x44, 0x65, 0x6c, 0x65, 0x67,
|
||||
0x61, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x02, 0x44, 0x6f, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b,
|
||||
0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_model_delegate_proto_goTypes = []interface{}{
|
||||
(*Request)(nil), // 0: grpc.Request
|
||||
(*Response)(nil), // 1: grpc.Response
|
||||
}
|
||||
var file_services_model_delegate_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.ModelDelegate.Do:input_type -> grpc.Request
|
||||
1, // 1: grpc.ModelDelegate.Do:output_type -> grpc.Response
|
||||
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_services_model_delegate_proto_init() }
|
||||
func file_services_model_delegate_proto_init() {
|
||||
if File_services_model_delegate_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_request_proto_init()
|
||||
file_entity_response_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_model_delegate_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_model_delegate_proto_goTypes,
|
||||
DependencyIndexes: file_services_model_delegate_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_model_delegate_proto = out.File
|
||||
file_services_model_delegate_proto_rawDesc = nil
|
||||
file_services_model_delegate_proto_goTypes = nil
|
||||
file_services_model_delegate_proto_depIdxs = nil
|
||||
}
|
||||
105
grpc/model_delegate_grpc.pb.go
Normal file
105
grpc/model_delegate_grpc.pb.go
Normal file
@@ -0,0 +1,105 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/model_delegate.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// ModelDelegateClient is the client API for ModelDelegate 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 ModelDelegateClient interface {
|
||||
Do(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type modelDelegateClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewModelDelegateClient(cc grpc.ClientConnInterface) ModelDelegateClient {
|
||||
return &modelDelegateClient{cc}
|
||||
}
|
||||
|
||||
func (c *modelDelegateClient) Do(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.ModelDelegate/Do", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ModelDelegateServer is the server API for ModelDelegate service.
|
||||
// All implementations must embed UnimplementedModelDelegateServer
|
||||
// for forward compatibility
|
||||
type ModelDelegateServer interface {
|
||||
Do(context.Context, *Request) (*Response, error)
|
||||
mustEmbedUnimplementedModelDelegateServer()
|
||||
}
|
||||
|
||||
// UnimplementedModelDelegateServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedModelDelegateServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedModelDelegateServer) Do(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Do not implemented")
|
||||
}
|
||||
func (UnimplementedModelDelegateServer) mustEmbedUnimplementedModelDelegateServer() {}
|
||||
|
||||
// UnsafeModelDelegateServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ModelDelegateServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeModelDelegateServer interface {
|
||||
mustEmbedUnimplementedModelDelegateServer()
|
||||
}
|
||||
|
||||
func RegisterModelDelegateServer(s grpc.ServiceRegistrar, srv ModelDelegateServer) {
|
||||
s.RegisterService(&ModelDelegate_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ModelDelegate_Do_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModelDelegateServer).Do(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.ModelDelegate/Do",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModelDelegateServer).Do(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ModelDelegate_ServiceDesc is the grpc.ServiceDesc for ModelDelegate service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ModelDelegate_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.ModelDelegate",
|
||||
HandlerType: (*ModelDelegateServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Do",
|
||||
Handler: _ModelDelegate_Do_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "services/model_delegate.proto",
|
||||
}
|
||||
1316
grpc/model_service_v2_request.pb.go
Normal file
1316
grpc/model_service_v2_request.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
251
grpc/node.pb.go
Normal file
251
grpc/node.pb.go
Normal file
@@ -0,0 +1,251 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: models/node.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Node struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
XId string `protobuf:"bytes,1,opt,name=_id,json=Id,proto3" json:"_id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"`
|
||||
Port string `protobuf:"bytes,5,opt,name=port,proto3" json:"port,omitempty"`
|
||||
Mac string `protobuf:"bytes,6,opt,name=mac,proto3" json:"mac,omitempty"`
|
||||
Hostname string `protobuf:"bytes,7,opt,name=hostname,proto3" json:"hostname,omitempty"`
|
||||
Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Key string `protobuf:"bytes,9,opt,name=key,proto3" json:"key,omitempty"`
|
||||
IsMaster bool `protobuf:"varint,11,opt,name=is_master,json=isMaster,proto3" json:"is_master,omitempty"`
|
||||
UpdateTs string `protobuf:"bytes,12,opt,name=update_ts,json=updateTs,proto3" json:"update_ts,omitempty"`
|
||||
CreateTs string `protobuf:"bytes,13,opt,name=create_ts,json=createTs,proto3" json:"create_ts,omitempty"`
|
||||
UpdateTsUnix int64 `protobuf:"varint,14,opt,name=update_ts_unix,json=updateTsUnix,proto3" json:"update_ts_unix,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Node) Reset() {
|
||||
*x = Node{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_models_node_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Node) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Node) ProtoMessage() {}
|
||||
|
||||
func (x *Node) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_models_node_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use Node.ProtoReflect.Descriptor instead.
|
||||
func (*Node) Descriptor() ([]byte, []int) {
|
||||
return file_models_node_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Node) GetXId() string {
|
||||
if x != nil {
|
||||
return x.XId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetIp() string {
|
||||
if x != nil {
|
||||
return x.Ip
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetPort() string {
|
||||
if x != nil {
|
||||
return x.Port
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetMac() string {
|
||||
if x != nil {
|
||||
return x.Mac
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetHostname() string {
|
||||
if x != nil {
|
||||
return x.Hostname
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetIsMaster() bool {
|
||||
if x != nil {
|
||||
return x.IsMaster
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Node) GetUpdateTs() string {
|
||||
if x != nil {
|
||||
return x.UpdateTs
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetCreateTs() string {
|
||||
if x != nil {
|
||||
return x.CreateTs
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Node) GetUpdateTsUnix() int64 {
|
||||
if x != nil {
|
||||
return x.UpdateTsUnix
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_models_node_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_models_node_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0xae, 0x02, 0x0a, 0x04, 0x4e, 0x6f,
|
||||
0x64, 0x65, 0x12, 0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d,
|
||||
0x61, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73,
|
||||
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
|
||||
0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1b, 0x0a,
|
||||
0x09, 0x69, 0x73, 0x5f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x08, 0x69, 0x73, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74,
|
||||
0x65, 0x5f, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x72, 0x65, 0x61,
|
||||
0x74, 0x65, 0x54, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74,
|
||||
0x73, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x54, 0x73, 0x55, 0x6e, 0x69, 0x78, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b,
|
||||
0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_models_node_proto_rawDescOnce sync.Once
|
||||
file_models_node_proto_rawDescData = file_models_node_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_models_node_proto_rawDescGZIP() []byte {
|
||||
file_models_node_proto_rawDescOnce.Do(func() {
|
||||
file_models_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_node_proto_rawDescData)
|
||||
})
|
||||
return file_models_node_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_models_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_models_node_proto_goTypes = []interface{}{
|
||||
(*Node)(nil), // 0: grpc.Node
|
||||
}
|
||||
var file_models_node_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_models_node_proto_init() }
|
||||
func file_models_node_proto_init() {
|
||||
if File_models_node_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_models_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Node); 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_models_node_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_models_node_proto_goTypes,
|
||||
DependencyIndexes: file_models_node_proto_depIdxs,
|
||||
MessageInfos: file_models_node_proto_msgTypes,
|
||||
}.Build()
|
||||
File_models_node_proto = out.File
|
||||
file_models_node_proto_rawDesc = nil
|
||||
file_models_node_proto_goTypes = nil
|
||||
file_models_node_proto_depIdxs = nil
|
||||
}
|
||||
156
grpc/node_info.pb.go
Normal file
156
grpc/node_info.pb.go
Normal file
@@ -0,0 +1,156 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/node_info.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type NodeInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
IsMaster bool `protobuf:"varint,2,opt,name=is_master,json=isMaster,proto3" json:"is_master,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NodeInfo) Reset() {
|
||||
*x = NodeInfo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_node_info_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NodeInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NodeInfo) ProtoMessage() {}
|
||||
|
||||
func (x *NodeInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_node_info_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead.
|
||||
func (*NodeInfo) Descriptor() ([]byte, []int) {
|
||||
return file_entity_node_info_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *NodeInfo) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodeInfo) GetIsMaster() bool {
|
||||
if x != nil {
|
||||
return x.IsMaster
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_entity_node_info_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_node_info_proto_rawDesc = []byte{
|
||||
0x0a, 0x16, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e,
|
||||
0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x39,
|
||||
0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09,
|
||||
0x69, 0x73, 0x5f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x08, 0x69, 0x73, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67,
|
||||
0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_node_info_proto_rawDescOnce sync.Once
|
||||
file_entity_node_info_proto_rawDescData = file_entity_node_info_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_node_info_proto_rawDescGZIP() []byte {
|
||||
file_entity_node_info_proto_rawDescOnce.Do(func() {
|
||||
file_entity_node_info_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_node_info_proto_rawDescData)
|
||||
})
|
||||
return file_entity_node_info_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_node_info_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_entity_node_info_proto_goTypes = []interface{}{
|
||||
(*NodeInfo)(nil), // 0: grpc.NodeInfo
|
||||
}
|
||||
var file_entity_node_info_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_entity_node_info_proto_init() }
|
||||
func file_entity_node_info_proto_init() {
|
||||
if File_entity_node_info_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entity_node_info_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NodeInfo); 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_entity_node_info_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_node_info_proto_goTypes,
|
||||
DependencyIndexes: file_entity_node_info_proto_depIdxs,
|
||||
MessageInfos: file_entity_node_info_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entity_node_info_proto = out.File
|
||||
file_entity_node_info_proto_rawDesc = nil
|
||||
file_entity_node_info_proto_goTypes = nil
|
||||
file_entity_node_info_proto_depIdxs = nil
|
||||
}
|
||||
104
grpc/node_service.pb.go
Normal file
104
grpc/node_service.pb.go
Normal file
@@ -0,0 +1,104 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/node_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_node_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_node_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67,
|
||||
0x72, 0x70, 0x63, 0x1a, 0x14, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
||||
0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x1a, 0x1b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xfa, 0x01,
|
||||
0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2b, 0x0a,
|
||||
0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x0d, 0x53, 0x65,
|
||||
0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x0d, 0x2e, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x27, 0x0a, 0x04,
|
||||
0x50, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||
0x62, 0x65, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x2e, 0x0a, 0x0b, 0x55, 0x6e,
|
||||
0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b,
|
||||
0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_node_service_proto_goTypes = []interface{}{
|
||||
(*Request)(nil), // 0: grpc.Request
|
||||
(*Response)(nil), // 1: grpc.Response
|
||||
(*StreamMessage)(nil), // 2: grpc.StreamMessage
|
||||
}
|
||||
var file_services_node_service_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.NodeService.Register:input_type -> grpc.Request
|
||||
0, // 1: grpc.NodeService.SendHeartbeat:input_type -> grpc.Request
|
||||
0, // 2: grpc.NodeService.Ping:input_type -> grpc.Request
|
||||
0, // 3: grpc.NodeService.Subscribe:input_type -> grpc.Request
|
||||
0, // 4: grpc.NodeService.Unsubscribe:input_type -> grpc.Request
|
||||
1, // 5: grpc.NodeService.Register:output_type -> grpc.Response
|
||||
1, // 6: grpc.NodeService.SendHeartbeat:output_type -> grpc.Response
|
||||
1, // 7: grpc.NodeService.Ping:output_type -> grpc.Response
|
||||
2, // 8: grpc.NodeService.Subscribe:output_type -> grpc.StreamMessage
|
||||
1, // 9: grpc.NodeService.Unsubscribe:output_type -> grpc.Response
|
||||
5, // [5:10] is the sub-list for method output_type
|
||||
0, // [0:5] 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_services_node_service_proto_init() }
|
||||
func file_services_node_service_proto_init() {
|
||||
if File_services_node_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_request_proto_init()
|
||||
file_entity_response_proto_init()
|
||||
file_entity_stream_message_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_node_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_node_service_proto_goTypes,
|
||||
DependencyIndexes: file_services_node_service_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_node_service_proto = out.File
|
||||
file_services_node_service_proto_rawDesc = nil
|
||||
file_services_node_service_proto_goTypes = nil
|
||||
file_services_node_service_proto_depIdxs = nil
|
||||
}
|
||||
277
grpc/node_service_grpc.pb.go
Normal file
277
grpc/node_service_grpc.pb.go
Normal file
@@ -0,0 +1,277 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/node_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// NodeServiceClient is the client API for NodeService 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 NodeServiceClient interface {
|
||||
Register(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
SendHeartbeat(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
Subscribe(ctx context.Context, in *Request, opts ...grpc.CallOption) (NodeService_SubscribeClient, error)
|
||||
Unsubscribe(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type nodeServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient {
|
||||
return &nodeServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *nodeServiceClient) Register(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.NodeService/Register", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *nodeServiceClient) SendHeartbeat(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.NodeService/SendHeartbeat", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *nodeServiceClient) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.NodeService/Ping", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *nodeServiceClient) Subscribe(ctx context.Context, in *Request, opts ...grpc.CallOption) (NodeService_SubscribeClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &NodeService_ServiceDesc.Streams[0], "/grpc.NodeService/Subscribe", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &nodeServiceSubscribeClient{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 NodeService_SubscribeClient interface {
|
||||
Recv() (*StreamMessage, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type nodeServiceSubscribeClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *nodeServiceSubscribeClient) Recv() (*StreamMessage, error) {
|
||||
m := new(StreamMessage)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *nodeServiceClient) Unsubscribe(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.NodeService/Unsubscribe", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// NodeServiceServer is the server API for NodeService service.
|
||||
// All implementations must embed UnimplementedNodeServiceServer
|
||||
// for forward compatibility
|
||||
type NodeServiceServer interface {
|
||||
Register(context.Context, *Request) (*Response, error)
|
||||
SendHeartbeat(context.Context, *Request) (*Response, error)
|
||||
Ping(context.Context, *Request) (*Response, error)
|
||||
Subscribe(*Request, NodeService_SubscribeServer) error
|
||||
Unsubscribe(context.Context, *Request) (*Response, error)
|
||||
mustEmbedUnimplementedNodeServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedNodeServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedNodeServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedNodeServiceServer) Register(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
||||
}
|
||||
func (UnimplementedNodeServiceServer) SendHeartbeat(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SendHeartbeat not implemented")
|
||||
}
|
||||
func (UnimplementedNodeServiceServer) Ping(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
||||
}
|
||||
func (UnimplementedNodeServiceServer) Subscribe(*Request, NodeService_SubscribeServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
|
||||
}
|
||||
func (UnimplementedNodeServiceServer) Unsubscribe(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Unsubscribe not implemented")
|
||||
}
|
||||
func (UnimplementedNodeServiceServer) mustEmbedUnimplementedNodeServiceServer() {}
|
||||
|
||||
// UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to NodeServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeNodeServiceServer interface {
|
||||
mustEmbedUnimplementedNodeServiceServer()
|
||||
}
|
||||
|
||||
func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) {
|
||||
s.RegisterService(&NodeService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _NodeService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServiceServer).Register(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.NodeService/Register",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServiceServer).Register(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NodeService_SendHeartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServiceServer).SendHeartbeat(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.NodeService/SendHeartbeat",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServiceServer).SendHeartbeat(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NodeService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServiceServer).Ping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.NodeService/Ping",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServiceServer).Ping(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NodeService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(Request)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(NodeServiceServer).Subscribe(m, &nodeServiceSubscribeServer{stream})
|
||||
}
|
||||
|
||||
type NodeService_SubscribeServer interface {
|
||||
Send(*StreamMessage) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type nodeServiceSubscribeServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *nodeServiceSubscribeServer) Send(m *StreamMessage) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func _NodeService_Unsubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServiceServer).Unsubscribe(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.NodeService/Unsubscribe",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServiceServer).Unsubscribe(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var NodeService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.NodeService",
|
||||
HandlerType: (*NodeServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Register",
|
||||
Handler: _NodeService_Register_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendHeartbeat",
|
||||
Handler: _NodeService_SendHeartbeat_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Ping",
|
||||
Handler: _NodeService_Ping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Unsubscribe",
|
||||
Handler: _NodeService_Unsubscribe_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Subscribe",
|
||||
Handler: _NodeService_Subscribe_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "services/node_service.proto",
|
||||
}
|
||||
166
grpc/plugin_request.pb.go
Normal file
166
grpc/plugin_request.pb.go
Normal file
@@ -0,0 +1,166 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/plugin_request.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type PluginRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
NodeKey string `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PluginRequest) Reset() {
|
||||
*x = PluginRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_plugin_request_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PluginRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PluginRequest) ProtoMessage() {}
|
||||
|
||||
func (x *PluginRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_plugin_request_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use PluginRequest.ProtoReflect.Descriptor instead.
|
||||
func (*PluginRequest) Descriptor() ([]byte, []int) {
|
||||
return file_entity_plugin_request_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *PluginRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PluginRequest) GetNodeKey() string {
|
||||
if x != nil {
|
||||
return x.NodeKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PluginRequest) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_entity_plugin_request_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_plugin_request_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f,
|
||||
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67,
|
||||
0x72, 0x70, 0x63, 0x22, 0x52, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65,
|
||||
0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65,
|
||||
0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70,
|
||||
0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_plugin_request_proto_rawDescOnce sync.Once
|
||||
file_entity_plugin_request_proto_rawDescData = file_entity_plugin_request_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_plugin_request_proto_rawDescGZIP() []byte {
|
||||
file_entity_plugin_request_proto_rawDescOnce.Do(func() {
|
||||
file_entity_plugin_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_plugin_request_proto_rawDescData)
|
||||
})
|
||||
return file_entity_plugin_request_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_plugin_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_entity_plugin_request_proto_goTypes = []interface{}{
|
||||
(*PluginRequest)(nil), // 0: grpc.PluginRequest
|
||||
}
|
||||
var file_entity_plugin_request_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_entity_plugin_request_proto_init() }
|
||||
func file_entity_plugin_request_proto_init() {
|
||||
if File_entity_plugin_request_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entity_plugin_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PluginRequest); 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_entity_plugin_request_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_plugin_request_proto_goTypes,
|
||||
DependencyIndexes: file_entity_plugin_request_proto_depIdxs,
|
||||
MessageInfos: file_entity_plugin_request_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entity_plugin_request_proto = out.File
|
||||
file_entity_plugin_request_proto_rawDesc = nil
|
||||
file_entity_plugin_request_proto_goTypes = nil
|
||||
file_entity_plugin_request_proto_depIdxs = nil
|
||||
}
|
||||
96
grpc/plugin_service.pb.go
Normal file
96
grpc/plugin_service.pb.go
Normal file
@@ -0,0 +1,96 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/plugin_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_plugin_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_plugin_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69,
|
||||
0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x70, 0x6c,
|
||||
0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
||||
0x79, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb5, 0x01, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69,
|
||||
0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69,
|
||||
0x73, 0x74, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x6c, 0x75, 0x67,
|
||||
0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x09, 0x53,
|
||||
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e,
|
||||
0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e,
|
||||
0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x36, 0x0a, 0x04, 0x50, 0x6f, 0x6c, 0x6c, 0x12, 0x13,
|
||||
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
|
||||
0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x08,
|
||||
0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_plugin_service_proto_goTypes = []interface{}{
|
||||
(*PluginRequest)(nil), // 0: grpc.PluginRequest
|
||||
(*StreamMessage)(nil), // 1: grpc.StreamMessage
|
||||
(*Response)(nil), // 2: grpc.Response
|
||||
}
|
||||
var file_services_plugin_service_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.PluginService.Register:input_type -> grpc.PluginRequest
|
||||
0, // 1: grpc.PluginService.Subscribe:input_type -> grpc.PluginRequest
|
||||
1, // 2: grpc.PluginService.Poll:input_type -> grpc.StreamMessage
|
||||
2, // 3: grpc.PluginService.Register:output_type -> grpc.Response
|
||||
1, // 4: grpc.PluginService.Subscribe:output_type -> grpc.StreamMessage
|
||||
1, // 5: grpc.PluginService.Poll:output_type -> grpc.StreamMessage
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] 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_services_plugin_service_proto_init() }
|
||||
func file_services_plugin_service_proto_init() {
|
||||
if File_services_plugin_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_plugin_request_proto_init()
|
||||
file_entity_response_proto_init()
|
||||
file_entity_stream_message_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_plugin_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_plugin_service_proto_goTypes,
|
||||
DependencyIndexes: file_services_plugin_service_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_plugin_service_proto = out.File
|
||||
file_services_plugin_service_proto_rawDesc = nil
|
||||
file_services_plugin_service_proto_goTypes = nil
|
||||
file_services_plugin_service_proto_depIdxs = nil
|
||||
}
|
||||
237
grpc/plugin_service_grpc.pb.go
Normal file
237
grpc/plugin_service_grpc.pb.go
Normal file
@@ -0,0 +1,237 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/plugin_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// PluginServiceClient is the client API for PluginService 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 PluginServiceClient interface {
|
||||
Register(ctx context.Context, in *PluginRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Subscribe(ctx context.Context, in *PluginRequest, opts ...grpc.CallOption) (PluginService_SubscribeClient, error)
|
||||
Poll(ctx context.Context, opts ...grpc.CallOption) (PluginService_PollClient, error)
|
||||
}
|
||||
|
||||
type pluginServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPluginServiceClient(cc grpc.ClientConnInterface) PluginServiceClient {
|
||||
return &pluginServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *pluginServiceClient) Register(ctx context.Context, in *PluginRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.PluginService/Register", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pluginServiceClient) Subscribe(ctx context.Context, in *PluginRequest, opts ...grpc.CallOption) (PluginService_SubscribeClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &PluginService_ServiceDesc.Streams[0], "/grpc.PluginService/Subscribe", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &pluginServiceSubscribeClient{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 PluginService_SubscribeClient interface {
|
||||
Recv() (*StreamMessage, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type pluginServiceSubscribeClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *pluginServiceSubscribeClient) Recv() (*StreamMessage, error) {
|
||||
m := new(StreamMessage)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *pluginServiceClient) Poll(ctx context.Context, opts ...grpc.CallOption) (PluginService_PollClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &PluginService_ServiceDesc.Streams[1], "/grpc.PluginService/Poll", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &pluginServicePollClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type PluginService_PollClient interface {
|
||||
Send(*StreamMessage) error
|
||||
Recv() (*StreamMessage, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type pluginServicePollClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *pluginServicePollClient) Send(m *StreamMessage) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *pluginServicePollClient) Recv() (*StreamMessage, error) {
|
||||
m := new(StreamMessage)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// PluginServiceServer is the server API for PluginService service.
|
||||
// All implementations must embed UnimplementedPluginServiceServer
|
||||
// for forward compatibility
|
||||
type PluginServiceServer interface {
|
||||
Register(context.Context, *PluginRequest) (*Response, error)
|
||||
Subscribe(*PluginRequest, PluginService_SubscribeServer) error
|
||||
Poll(PluginService_PollServer) error
|
||||
mustEmbedUnimplementedPluginServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPluginServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedPluginServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedPluginServiceServer) Register(context.Context, *PluginRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
||||
}
|
||||
func (UnimplementedPluginServiceServer) Subscribe(*PluginRequest, PluginService_SubscribeServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
|
||||
}
|
||||
func (UnimplementedPluginServiceServer) Poll(PluginService_PollServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Poll not implemented")
|
||||
}
|
||||
func (UnimplementedPluginServiceServer) mustEmbedUnimplementedPluginServiceServer() {}
|
||||
|
||||
// UnsafePluginServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PluginServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePluginServiceServer interface {
|
||||
mustEmbedUnimplementedPluginServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer) {
|
||||
s.RegisterService(&PluginService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PluginService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PluginRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PluginServiceServer).Register(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.PluginService/Register",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PluginServiceServer).Register(ctx, req.(*PluginRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PluginService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(PluginRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(PluginServiceServer).Subscribe(m, &pluginServiceSubscribeServer{stream})
|
||||
}
|
||||
|
||||
type PluginService_SubscribeServer interface {
|
||||
Send(*StreamMessage) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type pluginServiceSubscribeServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *pluginServiceSubscribeServer) Send(m *StreamMessage) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func _PluginService_Poll_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(PluginServiceServer).Poll(&pluginServicePollServer{stream})
|
||||
}
|
||||
|
||||
type PluginService_PollServer interface {
|
||||
Send(*StreamMessage) error
|
||||
Recv() (*StreamMessage, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type pluginServicePollServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *pluginServicePollServer) Send(m *StreamMessage) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *pluginServicePollServer) Recv() (*StreamMessage, error) {
|
||||
m := new(StreamMessage)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// PluginService_ServiceDesc is the grpc.ServiceDesc for PluginService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PluginService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.PluginService",
|
||||
HandlerType: (*PluginServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Register",
|
||||
Handler: _PluginService_Register_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Subscribe",
|
||||
Handler: _PluginService_Subscribe_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "Poll",
|
||||
Handler: _PluginService_Poll_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "services/plugin_service.proto",
|
||||
}
|
||||
32
grpc/proto/entity/dependencies_service_v2_request.proto
Normal file
32
grpc/proto/entity/dependencies_service_v2_request.proto
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message Dependency {
|
||||
string name = 1;
|
||||
string version = 2;
|
||||
}
|
||||
|
||||
message DependenciesServiceV2ConnectRequest {
|
||||
string node_key = 1;
|
||||
}
|
||||
|
||||
message DependenciesServiceV2SyncRequest {
|
||||
string node_key = 1;
|
||||
string lang = 2;
|
||||
repeated Dependency dependencies = 3;
|
||||
}
|
||||
|
||||
message DependenciesServiceV2InstallRequest {
|
||||
string node_key = 1;
|
||||
string lang = 2;
|
||||
repeated Dependency dependencies = 3;
|
||||
string proxy = 4;
|
||||
}
|
||||
|
||||
message DependenciesServiceV2UninstallRequest {
|
||||
string node_key = 1;
|
||||
string lang = 2;
|
||||
repeated Dependency dependencies = 3;
|
||||
}
|
||||
95
grpc/proto/entity/model_service_v2_request.proto
Normal file
95
grpc/proto/entity/model_service_v2_request.proto
Normal file
@@ -0,0 +1,95 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message ModelServiceV2GetByIdRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
string id = 3;
|
||||
}
|
||||
|
||||
message ModelServiceV2GetOneRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
bytes find_options = 4;
|
||||
}
|
||||
|
||||
message ModelServiceV2GetManyRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
bytes find_options = 4;
|
||||
}
|
||||
|
||||
message ModelServiceV2DeleteByIdRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
string id = 3;
|
||||
}
|
||||
|
||||
message ModelServiceV2DeleteOneRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
}
|
||||
|
||||
message ModelServiceV2DeleteManyRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
}
|
||||
|
||||
message ModelServiceV2UpdateByIdRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
string id = 3;
|
||||
bytes update = 4;
|
||||
}
|
||||
|
||||
message ModelServiceV2UpdateOneRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
bytes update = 4;
|
||||
}
|
||||
|
||||
message ModelServiceV2UpdateManyRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
bytes update = 4;
|
||||
}
|
||||
|
||||
message ModelServiceV2ReplaceByIdRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
string id = 3;
|
||||
bytes model = 4;
|
||||
}
|
||||
|
||||
message ModelServiceV2ReplaceOneRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
bytes model = 4;
|
||||
}
|
||||
|
||||
message ModelServiceV2InsertOneRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes model = 3;
|
||||
}
|
||||
|
||||
message ModelServiceV2InsertManyRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes models = 3;
|
||||
}
|
||||
|
||||
message ModelServiceV2CountRequest {
|
||||
string node_key = 1;
|
||||
string model_type = 2;
|
||||
bytes query = 3;
|
||||
}
|
||||
9
grpc/proto/entity/node_info.proto
Normal file
9
grpc/proto/entity/node_info.proto
Normal file
@@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message NodeInfo {
|
||||
string key = 1;
|
||||
bool is_master = 2;
|
||||
}
|
||||
10
grpc/proto/entity/plugin_request.proto
Normal file
10
grpc/proto/entity/plugin_request.proto
Normal file
@@ -0,0 +1,10 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message PluginRequest {
|
||||
string name = 1;
|
||||
string node_key = 2;
|
||||
bytes data = 3;
|
||||
}
|
||||
9
grpc/proto/entity/request.proto
Normal file
9
grpc/proto/entity/request.proto
Normal file
@@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message Request {
|
||||
string node_key = 1;
|
||||
bytes data = 2;
|
||||
}
|
||||
14
grpc/proto/entity/response.proto
Normal file
14
grpc/proto/entity/response.proto
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/response_code.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message Response {
|
||||
ResponseCode code = 1;
|
||||
string message = 2;
|
||||
bytes data = 3;
|
||||
string error = 4;
|
||||
int64 total = 5;
|
||||
}
|
||||
8
grpc/proto/entity/response_code.proto
Normal file
8
grpc/proto/entity/response_code.proto
Normal file
@@ -0,0 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = ".;grpc";
|
||||
|
||||
enum ResponseCode {
|
||||
OK = 0;
|
||||
ERROR = 1;
|
||||
}
|
||||
16
grpc/proto/entity/stream_message.proto
Normal file
16
grpc/proto/entity/stream_message.proto
Normal file
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/stream_message_code.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message StreamMessage {
|
||||
StreamMessageCode code = 1;
|
||||
string node_key = 2;
|
||||
string key = 3;
|
||||
string from = 4;
|
||||
string to = 5;
|
||||
bytes data = 6;
|
||||
string error = 7;
|
||||
}
|
||||
33
grpc/proto/entity/stream_message_code.proto
Normal file
33
grpc/proto/entity/stream_message_code.proto
Normal file
@@ -0,0 +1,33 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
enum StreamMessageCode {
|
||||
// ping worker nodes to check their health
|
||||
PING = 0;
|
||||
// ask worker node(s) to run task with given id
|
||||
RUN_TASK = 1;
|
||||
// ask worker node(s) to cancel task with given id
|
||||
CANCEL_TASK = 2;
|
||||
// insert data
|
||||
INSERT_DATA = 3;
|
||||
// insert logs
|
||||
INSERT_LOGS = 4;
|
||||
// send event
|
||||
SEND_EVENT = 5;
|
||||
// install plugin
|
||||
INSTALL_PLUGIN = 6;
|
||||
// uninstall plugin
|
||||
UNINSTALL_PLUGIN = 7;
|
||||
// start plugin
|
||||
START_PLUGIN = 8;
|
||||
// stop plugin
|
||||
STOP_PLUGIN = 9;
|
||||
// connect
|
||||
CONNECT = 10;
|
||||
// disconnect
|
||||
DISCONNECT = 11;
|
||||
// send
|
||||
SEND = 12;
|
||||
}
|
||||
9
grpc/proto/entity/stream_message_data_task.proto
Normal file
9
grpc/proto/entity/stream_message_data_task.proto
Normal file
@@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message StreamMessageDataTask {
|
||||
string task_id = 1;
|
||||
string data = 2;
|
||||
}
|
||||
19
grpc/proto/models/node.proto
Normal file
19
grpc/proto/models/node.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message Node {
|
||||
string _id = 1;
|
||||
string name = 2;
|
||||
string ip = 3;
|
||||
string port = 5;
|
||||
string mac = 6;
|
||||
string hostname = 7;
|
||||
string description = 8;
|
||||
string key = 9;
|
||||
bool is_master = 11;
|
||||
string update_ts = 12;
|
||||
string create_ts = 13;
|
||||
int64 update_ts_unix = 14;
|
||||
}
|
||||
18
grpc/proto/models/task.proto
Normal file
18
grpc/proto/models/task.proto
Normal file
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
message Task {
|
||||
string _id = 1;
|
||||
string spider_id = 2;
|
||||
string status = 5;
|
||||
string node_id = 6;
|
||||
string cmd = 8;
|
||||
string param = 9;
|
||||
string error = 10;
|
||||
int32 pid = 16;
|
||||
string run_type = 17;
|
||||
string schedule_id = 18;
|
||||
string type = 19;
|
||||
}
|
||||
14
grpc/proto/services/dependency_service_v2.proto
Normal file
14
grpc/proto/services/dependency_service_v2.proto
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/dependencies_service_v2_request.proto";
|
||||
import "entity/response.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service DependencyServiceV2 {
|
||||
rpc Connect(stream DependenciesServiceV2ConnectRequest) returns (Response){};
|
||||
rpc Sync(DependenciesServiceV2SyncRequest) returns (Response){};
|
||||
rpc Install(stream DependenciesServiceV2InstallRequest) returns (stream Response){};
|
||||
rpc UninstallDependencies(stream DependenciesServiceV2UninstallRequest) returns (stream Response){};
|
||||
}
|
||||
10
grpc/proto/services/message_service.proto
Normal file
10
grpc/proto/services/message_service.proto
Normal file
@@ -0,0 +1,10 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/stream_message.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service MessageService {
|
||||
rpc Connect(stream StreamMessage) returns (stream StreamMessage){};
|
||||
}
|
||||
22
grpc/proto/services/model_base_service.proto
Normal file
22
grpc/proto/services/model_base_service.proto
Normal file
@@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/request.proto";
|
||||
import "entity/response.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service ModelBaseService {
|
||||
rpc GetById(Request) returns (Response){};
|
||||
rpc Get(Request) returns (Response){};
|
||||
rpc GetList(Request) returns (Response){};
|
||||
rpc DeleteById(Request) returns (Response){};
|
||||
rpc Delete(Request) returns (Response){};
|
||||
rpc DeleteList(Request) returns (Response){};
|
||||
rpc ForceDeleteList(Request) returns (Response){};
|
||||
rpc UpdateById(Request) returns (Response){};
|
||||
rpc Update(Request) returns (Response){};
|
||||
rpc UpdateDoc(Request) returns (Response){};
|
||||
rpc Insert(Request) returns (Response){};
|
||||
rpc Count(Request) returns (Response){};
|
||||
}
|
||||
24
grpc/proto/services/model_base_service_v2.proto
Normal file
24
grpc/proto/services/model_base_service_v2.proto
Normal file
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/model_service_v2_request.proto";
|
||||
import "entity/response.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service ModelBaseServiceV2 {
|
||||
rpc GetById(ModelServiceV2GetByIdRequest) returns (Response){};
|
||||
rpc GetOne(ModelServiceV2GetOneRequest) returns (Response){};
|
||||
rpc GetMany(ModelServiceV2GetManyRequest) returns (Response){};
|
||||
rpc DeleteById(ModelServiceV2DeleteByIdRequest) returns (Response){};
|
||||
rpc DeleteOne(ModelServiceV2DeleteOneRequest) returns (Response){};
|
||||
rpc DeleteMany(ModelServiceV2DeleteManyRequest) returns (Response){};
|
||||
rpc UpdateById(ModelServiceV2UpdateByIdRequest) returns (Response){};
|
||||
rpc UpdateOne(ModelServiceV2UpdateOneRequest) returns (Response){};
|
||||
rpc UpdateMany(ModelServiceV2UpdateManyRequest) returns (Response){};
|
||||
rpc ReplaceById(ModelServiceV2ReplaceByIdRequest) returns (Response){};
|
||||
rpc ReplaceOne(ModelServiceV2ReplaceOneRequest) returns (Response){};
|
||||
rpc InsertOne(ModelServiceV2InsertOneRequest) returns (Response){};
|
||||
rpc InsertMany(ModelServiceV2InsertManyRequest) returns (Response){};
|
||||
rpc Count(ModelServiceV2CountRequest) returns (Response){};
|
||||
}
|
||||
11
grpc/proto/services/model_delegate.proto
Normal file
11
grpc/proto/services/model_delegate.proto
Normal file
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/request.proto";
|
||||
import "entity/response.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service ModelDelegate {
|
||||
rpc Do(Request) returns (Response){};
|
||||
}
|
||||
16
grpc/proto/services/node_service.proto
Normal file
16
grpc/proto/services/node_service.proto
Normal file
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/request.proto";
|
||||
import "entity/response.proto";
|
||||
import "entity/stream_message.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service NodeService {
|
||||
rpc Register(Request) returns (Response){};
|
||||
rpc SendHeartbeat(Request) returns (Response){};
|
||||
rpc Ping(Request) returns (Response){};
|
||||
rpc Subscribe(Request) returns (stream StreamMessage){};
|
||||
rpc Unsubscribe(Request) returns (Response){};
|
||||
}
|
||||
14
grpc/proto/services/plugin_service.proto
Normal file
14
grpc/proto/services/plugin_service.proto
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/plugin_request.proto";
|
||||
import "entity/response.proto";
|
||||
import "entity/stream_message.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service PluginService {
|
||||
rpc Register(PluginRequest) returns (Response){};
|
||||
rpc Subscribe(PluginRequest) returns (stream StreamMessage){};
|
||||
rpc Poll(stream StreamMessage) returns (stream StreamMessage){};
|
||||
}
|
||||
14
grpc/proto/services/task_service.proto
Normal file
14
grpc/proto/services/task_service.proto
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "entity/request.proto";
|
||||
import "entity/response.proto";
|
||||
import "entity/stream_message.proto";
|
||||
|
||||
package grpc;
|
||||
option go_package = ".;grpc";
|
||||
|
||||
service TaskService {
|
||||
rpc Subscribe(stream StreamMessage) returns (Response){};
|
||||
rpc Fetch(Request) returns (Response){};
|
||||
rpc SendNotification(Request) returns (Response){};
|
||||
}
|
||||
156
grpc/request.pb.go
Normal file
156
grpc/request.pb.go
Normal file
@@ -0,0 +1,156 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/request.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Request struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Request) Reset() {
|
||||
*x = Request{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_request_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Request) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Request) ProtoMessage() {}
|
||||
|
||||
func (x *Request) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_request_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use Request.ProtoReflect.Descriptor instead.
|
||||
func (*Request) Descriptor() ([]byte, []int) {
|
||||
return file_entity_request_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Request) GetNodeKey() string {
|
||||
if x != nil {
|
||||
return x.NodeKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Request) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_entity_request_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_request_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x38, 0x0a, 0x07,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f,
|
||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b,
|
||||
0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_request_proto_rawDescOnce sync.Once
|
||||
file_entity_request_proto_rawDescData = file_entity_request_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_request_proto_rawDescGZIP() []byte {
|
||||
file_entity_request_proto_rawDescOnce.Do(func() {
|
||||
file_entity_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_request_proto_rawDescData)
|
||||
})
|
||||
return file_entity_request_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_entity_request_proto_goTypes = []interface{}{
|
||||
(*Request)(nil), // 0: grpc.Request
|
||||
}
|
||||
var file_entity_request_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_entity_request_proto_init() }
|
||||
func file_entity_request_proto_init() {
|
||||
if File_entity_request_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entity_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Request); 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_entity_request_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_request_proto_goTypes,
|
||||
DependencyIndexes: file_entity_request_proto_depIdxs,
|
||||
MessageInfos: file_entity_request_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entity_request_proto = out.File
|
||||
file_entity_request_proto_rawDesc = nil
|
||||
file_entity_request_proto_goTypes = nil
|
||||
file_entity_request_proto_depIdxs = nil
|
||||
}
|
||||
190
grpc/response.pb.go
Normal file
190
grpc/response.pb.go
Normal file
@@ -0,0 +1,190 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/response.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Response struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Code ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=ResponseCode" json:"code,omitempty"`
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
|
||||
Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Response) Reset() {
|
||||
*x = Response{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_response_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Response) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Response) ProtoMessage() {}
|
||||
|
||||
func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_response_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
|
||||
func (*Response) Descriptor() ([]byte, []int) {
|
||||
return file_entity_response_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Response) GetCode() ResponseCode {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ResponseCode_OK
|
||||
}
|
||||
|
||||
func (x *Response) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Response) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Response) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Response) GetTotal() int64 {
|
||||
if x != nil {
|
||||
return x.Total
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_entity_response_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_response_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x1a, 0x65,
|
||||
0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63,
|
||||
0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x08, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43,
|
||||
0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f,
|
||||
0x74, 0x61, 0x6c, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_response_proto_rawDescOnce sync.Once
|
||||
file_entity_response_proto_rawDescData = file_entity_response_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_response_proto_rawDescGZIP() []byte {
|
||||
file_entity_response_proto_rawDescOnce.Do(func() {
|
||||
file_entity_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_response_proto_rawDescData)
|
||||
})
|
||||
return file_entity_response_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_entity_response_proto_goTypes = []interface{}{
|
||||
(*Response)(nil), // 0: grpc.Response
|
||||
(ResponseCode)(0), // 1: ResponseCode
|
||||
}
|
||||
var file_entity_response_proto_depIdxs = []int32{
|
||||
1, // 0: grpc.Response.code:type_name -> ResponseCode
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] 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_entity_response_proto_init() }
|
||||
func file_entity_response_proto_init() {
|
||||
if File_entity_response_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_response_code_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entity_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Response); 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_entity_response_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_response_proto_goTypes,
|
||||
DependencyIndexes: file_entity_response_proto_depIdxs,
|
||||
MessageInfos: file_entity_response_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entity_response_proto = out.File
|
||||
file_entity_response_proto_rawDesc = nil
|
||||
file_entity_response_proto_goTypes = nil
|
||||
file_entity_response_proto_depIdxs = nil
|
||||
}
|
||||
132
grpc/response_code.pb.go
Normal file
132
grpc/response_code.pb.go
Normal file
@@ -0,0 +1,132 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/response_code.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type ResponseCode int32
|
||||
|
||||
const (
|
||||
ResponseCode_OK ResponseCode = 0
|
||||
ResponseCode_ERROR ResponseCode = 1
|
||||
)
|
||||
|
||||
// Enum value maps for ResponseCode.
|
||||
var (
|
||||
ResponseCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "ERROR",
|
||||
}
|
||||
ResponseCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"ERROR": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ResponseCode) Enum() *ResponseCode {
|
||||
p := new(ResponseCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ResponseCode) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ResponseCode) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_entity_response_code_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ResponseCode) Type() protoreflect.EnumType {
|
||||
return &file_entity_response_code_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ResponseCode) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResponseCode.Descriptor instead.
|
||||
func (ResponseCode) EnumDescriptor() ([]byte, []int) {
|
||||
return file_entity_response_code_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_entity_response_code_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_response_code_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x21, 0x0a, 0x0c,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x06, 0x0a, 0x02,
|
||||
0x4f, 0x4b, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x42,
|
||||
0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_response_code_proto_rawDescOnce sync.Once
|
||||
file_entity_response_code_proto_rawDescData = file_entity_response_code_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_response_code_proto_rawDescGZIP() []byte {
|
||||
file_entity_response_code_proto_rawDescOnce.Do(func() {
|
||||
file_entity_response_code_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_response_code_proto_rawDescData)
|
||||
})
|
||||
return file_entity_response_code_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_response_code_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_entity_response_code_proto_goTypes = []interface{}{
|
||||
(ResponseCode)(0), // 0: ResponseCode
|
||||
}
|
||||
var file_entity_response_code_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_entity_response_code_proto_init() }
|
||||
func file_entity_response_code_proto_init() {
|
||||
if File_entity_response_code_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_entity_response_code_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_response_code_proto_goTypes,
|
||||
DependencyIndexes: file_entity_response_code_proto_depIdxs,
|
||||
EnumInfos: file_entity_response_code_proto_enumTypes,
|
||||
}.Build()
|
||||
File_entity_response_code_proto = out.File
|
||||
file_entity_response_code_proto_rawDesc = nil
|
||||
file_entity_response_code_proto_goTypes = nil
|
||||
file_entity_response_code_proto_depIdxs = nil
|
||||
}
|
||||
210
grpc/stream_message.pb.go
Normal file
210
grpc/stream_message.pb.go
Normal file
@@ -0,0 +1,210 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/stream_message.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type StreamMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Code StreamMessageCode `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.StreamMessageCode" json:"code,omitempty"`
|
||||
NodeKey string `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
|
||||
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
|
||||
From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
|
||||
To string `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"`
|
||||
Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
|
||||
}
|
||||
|
||||
func (x *StreamMessage) Reset() {
|
||||
*x = StreamMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_stream_message_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *StreamMessage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamMessage) ProtoMessage() {}
|
||||
|
||||
func (x *StreamMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_stream_message_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamMessage.ProtoReflect.Descriptor instead.
|
||||
func (*StreamMessage) Descriptor() ([]byte, []int) {
|
||||
return file_entity_stream_message_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *StreamMessage) GetCode() StreamMessageCode {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return StreamMessageCode_PING
|
||||
}
|
||||
|
||||
func (x *StreamMessage) GetNodeKey() string {
|
||||
if x != nil {
|
||||
return x.NodeKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StreamMessage) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StreamMessage) GetFrom() string {
|
||||
if x != nil {
|
||||
return x.From
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StreamMessage) GetTo() string {
|
||||
if x != nil {
|
||||
return x.To
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StreamMessage) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StreamMessage) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_entity_stream_message_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_stream_message_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67,
|
||||
0x72, 0x70, 0x63, 0x1a, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x73, 0x74, 0x72, 0x65,
|
||||
0x61, 0x6d, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72,
|
||||
0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04,
|
||||
0x63, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72,
|
||||
0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42,
|
||||
0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_stream_message_proto_rawDescOnce sync.Once
|
||||
file_entity_stream_message_proto_rawDescData = file_entity_stream_message_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_stream_message_proto_rawDescGZIP() []byte {
|
||||
file_entity_stream_message_proto_rawDescOnce.Do(func() {
|
||||
file_entity_stream_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_stream_message_proto_rawDescData)
|
||||
})
|
||||
return file_entity_stream_message_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_stream_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_entity_stream_message_proto_goTypes = []interface{}{
|
||||
(*StreamMessage)(nil), // 0: grpc.StreamMessage
|
||||
(StreamMessageCode)(0), // 1: grpc.StreamMessageCode
|
||||
}
|
||||
var file_entity_stream_message_proto_depIdxs = []int32{
|
||||
1, // 0: grpc.StreamMessage.code:type_name -> grpc.StreamMessageCode
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] 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_entity_stream_message_proto_init() }
|
||||
func file_entity_stream_message_proto_init() {
|
||||
if File_entity_stream_message_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_stream_message_code_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entity_stream_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StreamMessage); 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_entity_stream_message_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_stream_message_proto_goTypes,
|
||||
DependencyIndexes: file_entity_stream_message_proto_depIdxs,
|
||||
MessageInfos: file_entity_stream_message_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entity_stream_message_proto = out.File
|
||||
file_entity_stream_message_proto_rawDesc = nil
|
||||
file_entity_stream_message_proto_goTypes = nil
|
||||
file_entity_stream_message_proto_depIdxs = nil
|
||||
}
|
||||
190
grpc/stream_message_code.pb.go
Normal file
190
grpc/stream_message_code.pb.go
Normal file
@@ -0,0 +1,190 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/stream_message_code.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type StreamMessageCode int32
|
||||
|
||||
const (
|
||||
// ping worker nodes to check their health
|
||||
StreamMessageCode_PING StreamMessageCode = 0
|
||||
// ask worker node(s) to run task with given id
|
||||
StreamMessageCode_RUN_TASK StreamMessageCode = 1
|
||||
// ask worker node(s) to cancel task with given id
|
||||
StreamMessageCode_CANCEL_TASK StreamMessageCode = 2
|
||||
// insert data
|
||||
StreamMessageCode_INSERT_DATA StreamMessageCode = 3
|
||||
// insert logs
|
||||
StreamMessageCode_INSERT_LOGS StreamMessageCode = 4
|
||||
// send event
|
||||
StreamMessageCode_SEND_EVENT StreamMessageCode = 5
|
||||
// install plugin
|
||||
StreamMessageCode_INSTALL_PLUGIN StreamMessageCode = 6
|
||||
// uninstall plugin
|
||||
StreamMessageCode_UNINSTALL_PLUGIN StreamMessageCode = 7
|
||||
// start plugin
|
||||
StreamMessageCode_START_PLUGIN StreamMessageCode = 8
|
||||
// stop plugin
|
||||
StreamMessageCode_STOP_PLUGIN StreamMessageCode = 9
|
||||
// connect
|
||||
StreamMessageCode_CONNECT StreamMessageCode = 10
|
||||
// disconnect
|
||||
StreamMessageCode_DISCONNECT StreamMessageCode = 11
|
||||
// send
|
||||
StreamMessageCode_SEND StreamMessageCode = 12
|
||||
)
|
||||
|
||||
// Enum value maps for StreamMessageCode.
|
||||
var (
|
||||
StreamMessageCode_name = map[int32]string{
|
||||
0: "PING",
|
||||
1: "RUN_TASK",
|
||||
2: "CANCEL_TASK",
|
||||
3: "INSERT_DATA",
|
||||
4: "INSERT_LOGS",
|
||||
5: "SEND_EVENT",
|
||||
6: "INSTALL_PLUGIN",
|
||||
7: "UNINSTALL_PLUGIN",
|
||||
8: "START_PLUGIN",
|
||||
9: "STOP_PLUGIN",
|
||||
10: "CONNECT",
|
||||
11: "DISCONNECT",
|
||||
12: "SEND",
|
||||
}
|
||||
StreamMessageCode_value = map[string]int32{
|
||||
"PING": 0,
|
||||
"RUN_TASK": 1,
|
||||
"CANCEL_TASK": 2,
|
||||
"INSERT_DATA": 3,
|
||||
"INSERT_LOGS": 4,
|
||||
"SEND_EVENT": 5,
|
||||
"INSTALL_PLUGIN": 6,
|
||||
"UNINSTALL_PLUGIN": 7,
|
||||
"START_PLUGIN": 8,
|
||||
"STOP_PLUGIN": 9,
|
||||
"CONNECT": 10,
|
||||
"DISCONNECT": 11,
|
||||
"SEND": 12,
|
||||
}
|
||||
)
|
||||
|
||||
func (x StreamMessageCode) Enum() *StreamMessageCode {
|
||||
p := new(StreamMessageCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x StreamMessageCode) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (StreamMessageCode) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_entity_stream_message_code_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (StreamMessageCode) Type() protoreflect.EnumType {
|
||||
return &file_entity_stream_message_code_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x StreamMessageCode) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamMessageCode.Descriptor instead.
|
||||
func (StreamMessageCode) EnumDescriptor() ([]byte, []int) {
|
||||
return file_entity_stream_message_code_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_entity_stream_message_code_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_stream_message_code_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x2a, 0xe2, 0x01, 0x0a, 0x11, 0x53, 0x74, 0x72,
|
||||
0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x08,
|
||||
0x0a, 0x04, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x55, 0x4e, 0x5f,
|
||||
0x54, 0x41, 0x53, 0x4b, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c,
|
||||
0x5f, 0x54, 0x41, 0x53, 0x4b, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x53, 0x45, 0x52,
|
||||
0x54, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x53, 0x45,
|
||||
0x52, 0x54, 0x5f, 0x4c, 0x4f, 0x47, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x45, 0x4e,
|
||||
0x44, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x53,
|
||||
0x54, 0x41, 0x4c, 0x4c, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x06, 0x12, 0x14, 0x0a,
|
||||
0x10, 0x55, 0x4e, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49,
|
||||
0x4e, 0x10, 0x07, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x50, 0x4c, 0x55,
|
||||
0x47, 0x49, 0x4e, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x50, 0x4c,
|
||||
0x55, 0x47, 0x49, 0x4e, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43,
|
||||
0x54, 0x10, 0x0a, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43,
|
||||
0x54, 0x10, 0x0b, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4e, 0x44, 0x10, 0x0c, 0x42, 0x08, 0x5a,
|
||||
0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_stream_message_code_proto_rawDescOnce sync.Once
|
||||
file_entity_stream_message_code_proto_rawDescData = file_entity_stream_message_code_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_stream_message_code_proto_rawDescGZIP() []byte {
|
||||
file_entity_stream_message_code_proto_rawDescOnce.Do(func() {
|
||||
file_entity_stream_message_code_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_stream_message_code_proto_rawDescData)
|
||||
})
|
||||
return file_entity_stream_message_code_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_stream_message_code_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_entity_stream_message_code_proto_goTypes = []interface{}{
|
||||
(StreamMessageCode)(0), // 0: grpc.StreamMessageCode
|
||||
}
|
||||
var file_entity_stream_message_code_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_entity_stream_message_code_proto_init() }
|
||||
func file_entity_stream_message_code_proto_init() {
|
||||
if File_entity_stream_message_code_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_entity_stream_message_code_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_stream_message_code_proto_goTypes,
|
||||
DependencyIndexes: file_entity_stream_message_code_proto_depIdxs,
|
||||
EnumInfos: file_entity_stream_message_code_proto_enumTypes,
|
||||
}.Build()
|
||||
File_entity_stream_message_code_proto = out.File
|
||||
file_entity_stream_message_code_proto_rawDesc = nil
|
||||
file_entity_stream_message_code_proto_goTypes = nil
|
||||
file_entity_stream_message_code_proto_depIdxs = nil
|
||||
}
|
||||
158
grpc/stream_message_data_task.pb.go
Normal file
158
grpc/stream_message_data_task.pb.go
Normal file
@@ -0,0 +1,158 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: entity/stream_message_data_task.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type StreamMessageDataTask struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *StreamMessageDataTask) Reset() {
|
||||
*x = StreamMessageDataTask{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entity_stream_message_data_task_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *StreamMessageDataTask) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamMessageDataTask) ProtoMessage() {}
|
||||
|
||||
func (x *StreamMessageDataTask) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entity_stream_message_data_task_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamMessageDataTask.ProtoReflect.Descriptor instead.
|
||||
func (*StreamMessageDataTask) Descriptor() ([]byte, []int) {
|
||||
return file_entity_stream_message_data_task_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *StreamMessageDataTask) GetTaskId() string {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StreamMessageDataTask) GetData() string {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_entity_stream_message_data_task_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entity_stream_message_data_task_proto_rawDesc = []byte{
|
||||
0x0a, 0x25, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x44, 0x0a,
|
||||
0x15, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x61,
|
||||
0x74, 0x61, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64,
|
||||
0x61, 0x74, 0x61, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entity_stream_message_data_task_proto_rawDescOnce sync.Once
|
||||
file_entity_stream_message_data_task_proto_rawDescData = file_entity_stream_message_data_task_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entity_stream_message_data_task_proto_rawDescGZIP() []byte {
|
||||
file_entity_stream_message_data_task_proto_rawDescOnce.Do(func() {
|
||||
file_entity_stream_message_data_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_stream_message_data_task_proto_rawDescData)
|
||||
})
|
||||
return file_entity_stream_message_data_task_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entity_stream_message_data_task_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_entity_stream_message_data_task_proto_goTypes = []interface{}{
|
||||
(*StreamMessageDataTask)(nil), // 0: grpc.StreamMessageDataTask
|
||||
}
|
||||
var file_entity_stream_message_data_task_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_entity_stream_message_data_task_proto_init() }
|
||||
func file_entity_stream_message_data_task_proto_init() {
|
||||
if File_entity_stream_message_data_task_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entity_stream_message_data_task_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StreamMessageDataTask); 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_entity_stream_message_data_task_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entity_stream_message_data_task_proto_goTypes,
|
||||
DependencyIndexes: file_entity_stream_message_data_task_proto_depIdxs,
|
||||
MessageInfos: file_entity_stream_message_data_task_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entity_stream_message_data_task_proto = out.File
|
||||
file_entity_stream_message_data_task_proto_rawDesc = nil
|
||||
file_entity_stream_message_data_task_proto_goTypes = nil
|
||||
file_entity_stream_message_data_task_proto_depIdxs = nil
|
||||
}
|
||||
241
grpc/task.pb.go
Normal file
241
grpc/task.pb.go
Normal file
@@ -0,0 +1,241 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: models/task.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Task struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
XId string `protobuf:"bytes,1,opt,name=_id,json=Id,proto3" json:"_id,omitempty"`
|
||||
SpiderId string `protobuf:"bytes,2,opt,name=spider_id,json=spiderId,proto3" json:"spider_id,omitempty"`
|
||||
Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
|
||||
NodeId string `protobuf:"bytes,6,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
|
||||
Cmd string `protobuf:"bytes,8,opt,name=cmd,proto3" json:"cmd,omitempty"`
|
||||
Param string `protobuf:"bytes,9,opt,name=param,proto3" json:"param,omitempty"`
|
||||
Error string `protobuf:"bytes,10,opt,name=error,proto3" json:"error,omitempty"`
|
||||
Pid int32 `protobuf:"varint,16,opt,name=pid,proto3" json:"pid,omitempty"`
|
||||
RunType string `protobuf:"bytes,17,opt,name=run_type,json=runType,proto3" json:"run_type,omitempty"`
|
||||
ScheduleId string `protobuf:"bytes,18,opt,name=schedule_id,json=scheduleId,proto3" json:"schedule_id,omitempty"`
|
||||
Type string `protobuf:"bytes,19,opt,name=type,proto3" json:"type,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Task) Reset() {
|
||||
*x = Task{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_models_task_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Task) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Task) ProtoMessage() {}
|
||||
|
||||
func (x *Task) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_models_task_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)
|
||||
}
|
||||
|
||||
// Deprecated: Use Task.ProtoReflect.Descriptor instead.
|
||||
func (*Task) Descriptor() ([]byte, []int) {
|
||||
return file_models_task_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Task) GetXId() string {
|
||||
if x != nil {
|
||||
return x.XId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetSpiderId() string {
|
||||
if x != nil {
|
||||
return x.SpiderId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetStatus() string {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetNodeId() string {
|
||||
if x != nil {
|
||||
return x.NodeId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetCmd() string {
|
||||
if x != nil {
|
||||
return x.Cmd
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetParam() string {
|
||||
if x != nil {
|
||||
return x.Param
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetPid() int32 {
|
||||
if x != nil {
|
||||
return x.Pid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetRunType() string {
|
||||
if x != nil {
|
||||
return x.RunType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetScheduleId() string {
|
||||
if x != nil {
|
||||
return x.ScheduleId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_models_task_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_models_task_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x85, 0x02, 0x0a, 0x04, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x12, 0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x02, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49,
|
||||
0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x63, 0x6d, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72,
|
||||
0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69,
|
||||
0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x11, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
|
||||
0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70,
|
||||
0x65, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_models_task_proto_rawDescOnce sync.Once
|
||||
file_models_task_proto_rawDescData = file_models_task_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_models_task_proto_rawDescGZIP() []byte {
|
||||
file_models_task_proto_rawDescOnce.Do(func() {
|
||||
file_models_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_task_proto_rawDescData)
|
||||
})
|
||||
return file_models_task_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_models_task_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_models_task_proto_goTypes = []interface{}{
|
||||
(*Task)(nil), // 0: grpc.Task
|
||||
}
|
||||
var file_models_task_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_models_task_proto_init() }
|
||||
func file_models_task_proto_init() {
|
||||
if File_models_task_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_models_task_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Task); 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_models_task_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_models_task_proto_goTypes,
|
||||
DependencyIndexes: file_models_task_proto_depIdxs,
|
||||
MessageInfos: file_models_task_proto_msgTypes,
|
||||
}.Build()
|
||||
File_models_task_proto = out.File
|
||||
file_models_task_proto_rawDesc = nil
|
||||
file_models_task_proto_goTypes = nil
|
||||
file_models_task_proto_depIdxs = nil
|
||||
}
|
||||
95
grpc/task_service.pb.go
Normal file
95
grpc/task_service.pb.go
Normal file
@@ -0,0 +1,95 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.20.1
|
||||
// source: services/task_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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 that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
var File_services_task_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_task_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x5f,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67,
|
||||
0x72, 0x70, 0x63, 0x1a, 0x14, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
||||
0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x1a, 0x1b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa2, 0x01,
|
||||
0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a,
|
||||
0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a,
|
||||
0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x28, 0x01, 0x12, 0x28, 0x0a, 0x05, 0x46, 0x65, 0x74, 0x63, 0x68, 0x12, 0x0d, 0x2e, 0x67,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x33, 0x0a,
|
||||
0x10, 0x53, 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_services_task_service_proto_goTypes = []interface{}{
|
||||
(*StreamMessage)(nil), // 0: grpc.StreamMessage
|
||||
(*Request)(nil), // 1: grpc.Request
|
||||
(*Response)(nil), // 2: grpc.Response
|
||||
}
|
||||
var file_services_task_service_proto_depIdxs = []int32{
|
||||
0, // 0: grpc.TaskService.Subscribe:input_type -> grpc.StreamMessage
|
||||
1, // 1: grpc.TaskService.Fetch:input_type -> grpc.Request
|
||||
1, // 2: grpc.TaskService.SendNotification:input_type -> grpc.Request
|
||||
2, // 3: grpc.TaskService.Subscribe:output_type -> grpc.Response
|
||||
2, // 4: grpc.TaskService.Fetch:output_type -> grpc.Response
|
||||
2, // 5: grpc.TaskService.SendNotification:output_type -> grpc.Response
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] 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_services_task_service_proto_init() }
|
||||
func file_services_task_service_proto_init() {
|
||||
if File_services_task_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entity_request_proto_init()
|
||||
file_entity_response_proto_init()
|
||||
file_entity_stream_message_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_task_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_task_service_proto_goTypes,
|
||||
DependencyIndexes: file_services_task_service_proto_depIdxs,
|
||||
}.Build()
|
||||
File_services_task_service_proto = out.File
|
||||
file_services_task_service_proto_rawDesc = nil
|
||||
file_services_task_service_proto_goTypes = nil
|
||||
file_services_task_service_proto_depIdxs = nil
|
||||
}
|
||||
212
grpc/task_service_grpc.pb.go
Normal file
212
grpc/task_service_grpc.pb.go
Normal file
@@ -0,0 +1,212 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.20.1
|
||||
// source: services/task_service.proto
|
||||
|
||||
package grpc
|
||||
|
||||
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.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// TaskServiceClient is the client API for TaskService 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 TaskServiceClient interface {
|
||||
Subscribe(ctx context.Context, opts ...grpc.CallOption) (TaskService_SubscribeClient, error)
|
||||
Fetch(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
SendNotification(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type taskServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTaskServiceClient(cc grpc.ClientConnInterface) TaskServiceClient {
|
||||
return &taskServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (TaskService_SubscribeClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &TaskService_ServiceDesc.Streams[0], "/grpc.TaskService/Subscribe", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &taskServiceSubscribeClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type TaskService_SubscribeClient interface {
|
||||
Send(*StreamMessage) error
|
||||
CloseAndRecv() (*Response, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type taskServiceSubscribeClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *taskServiceSubscribeClient) Send(m *StreamMessage) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *taskServiceSubscribeClient) 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
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) Fetch(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.TaskService/Fetch", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) SendNotification(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, "/grpc.TaskService/SendNotification", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TaskServiceServer is the server API for TaskService service.
|
||||
// All implementations must embed UnimplementedTaskServiceServer
|
||||
// for forward compatibility
|
||||
type TaskServiceServer interface {
|
||||
Subscribe(TaskService_SubscribeServer) error
|
||||
Fetch(context.Context, *Request) (*Response, error)
|
||||
SendNotification(context.Context, *Request) (*Response, error)
|
||||
mustEmbedUnimplementedTaskServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedTaskServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedTaskServiceServer) Subscribe(TaskService_SubscribeServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) Fetch(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) SendNotification(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SendNotification not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) mustEmbedUnimplementedTaskServiceServer() {}
|
||||
|
||||
// UnsafeTaskServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTaskServiceServer interface {
|
||||
mustEmbedUnimplementedTaskServiceServer()
|
||||
}
|
||||
|
||||
func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer) {
|
||||
s.RegisterService(&TaskService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _TaskService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(TaskServiceServer).Subscribe(&taskServiceSubscribeServer{stream})
|
||||
}
|
||||
|
||||
type TaskService_SubscribeServer interface {
|
||||
SendAndClose(*Response) error
|
||||
Recv() (*StreamMessage, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type taskServiceSubscribeServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *taskServiceSubscribeServer) SendAndClose(m *Response) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *taskServiceSubscribeServer) Recv() (*StreamMessage, error) {
|
||||
m := new(StreamMessage)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _TaskService_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).Fetch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.TaskService/Fetch",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).Fetch(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_SendNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).SendNotification(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.TaskService/SendNotification",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).SendNotification(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// TaskService_ServiceDesc is the grpc.ServiceDesc for TaskService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var TaskService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "grpc.TaskService",
|
||||
HandlerType: (*TaskServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Fetch",
|
||||
Handler: _TaskService_Fetch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendNotification",
|
||||
Handler: _TaskService_SendNotification_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Subscribe",
|
||||
Handler: _TaskService_Subscribe_Handler,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "services/task_service.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user