阶段性提交

This commit is contained in:
GoEdgeLab
2020-09-13 20:37:28 +08:00
parent 84868c1a0b
commit dc79c661d7
89 changed files with 1364 additions and 12899 deletions

View File

@@ -1,222 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_api_node.proto
package pb
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 APINode struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
ClusterId int64 `protobuf:"varint,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"`
UniqueId string `protobuf:"bytes,4,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"`
Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"`
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"`
Host string `protobuf:"bytes,8,opt,name=host,proto3" json:"host,omitempty"`
Port int32 `protobuf:"varint,9,opt,name=port,proto3" json:"port,omitempty"`
}
func (x *APINode) Reset() {
*x = APINode{}
if protoimpl.UnsafeEnabled {
mi := &file_model_api_node_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *APINode) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*APINode) ProtoMessage() {}
func (x *APINode) ProtoReflect() protoreflect.Message {
mi := &file_model_api_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 APINode.ProtoReflect.Descriptor instead.
func (*APINode) Descriptor() ([]byte, []int) {
return file_model_api_node_proto_rawDescGZIP(), []int{0}
}
func (x *APINode) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *APINode) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *APINode) GetClusterId() int64 {
if x != nil {
return x.ClusterId
}
return 0
}
func (x *APINode) GetUniqueId() string {
if x != nil {
return x.UniqueId
}
return ""
}
func (x *APINode) GetSecret() string {
if x != nil {
return x.Secret
}
return ""
}
func (x *APINode) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *APINode) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *APINode) GetHost() string {
if x != nil {
return x.Host
}
return ""
}
func (x *APINode) GetPort() int32 {
if x != nil {
return x.Port
}
return 0
}
var File_model_api_node_proto protoreflect.FileDescriptor
var file_model_api_node_proto_rawDesc = []byte{
0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, 0x64, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xdd, 0x01, 0x0a, 0x07, 0x41,
0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x71,
0x75, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x71,
0x75, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x09,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_api_node_proto_rawDescOnce sync.Once
file_model_api_node_proto_rawDescData = file_model_api_node_proto_rawDesc
)
func file_model_api_node_proto_rawDescGZIP() []byte {
file_model_api_node_proto_rawDescOnce.Do(func() {
file_model_api_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_api_node_proto_rawDescData)
})
return file_model_api_node_proto_rawDescData
}
var file_model_api_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_api_node_proto_goTypes = []interface{}{
(*APINode)(nil), // 0: pb.APINode
}
var file_model_api_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_model_api_node_proto_init() }
func file_model_api_node_proto_init() {
if File_model_api_node_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_model_api_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*APINode); 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_model_api_node_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_api_node_proto_goTypes,
DependencyIndexes: file_model_api_node_proto_depIdxs,
MessageInfos: file_model_api_node_proto_msgTypes,
}.Build()
File_model_api_node_proto = out.File
file_model_api_node_proto_rawDesc = nil
file_model_api_node_proto_goTypes = nil
file_model_api_node_proto_depIdxs = nil
}

View File

@@ -1,243 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_node.proto
package pb
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
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"`
IsInstalled bool `protobuf:"varint,5,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"`
Code string `protobuf:"bytes,6,opt,name=code,proto3" json:"code,omitempty"`
UniqueId string `protobuf:"bytes,7,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"`
Secret string `protobuf:"bytes,8,opt,name=secret,proto3" json:"secret,omitempty"`
Cluster *NodeCluster `protobuf:"bytes,32,opt,name=cluster,proto3" json:"cluster,omitempty"`
Login *NodeLogin `protobuf:"bytes,33,opt,name=login,proto3" json:"login,omitempty"`
}
func (x *Node) Reset() {
*x = Node{}
if protoimpl.UnsafeEnabled {
mi := &file_model_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_model_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_model_node_proto_rawDescGZIP(), []int{0}
}
func (x *Node) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *Node) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Node) GetStatus() string {
if x != nil {
return x.Status
}
return ""
}
func (x *Node) GetInstallDir() string {
if x != nil {
return x.InstallDir
}
return ""
}
func (x *Node) GetIsInstalled() bool {
if x != nil {
return x.IsInstalled
}
return false
}
func (x *Node) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *Node) GetUniqueId() string {
if x != nil {
return x.UniqueId
}
return ""
}
func (x *Node) GetSecret() string {
if x != nil {
return x.Secret
}
return ""
}
func (x *Node) GetCluster() *NodeCluster {
if x != nil {
return x.Cluster
}
return nil
}
func (x *Node) GetLogin() *NodeLogin {
if x != nil {
return x.Login
}
return nil
}
var File_model_node_proto protoreflect.FileDescriptor
var file_model_node_proto_rawDesc = []byte{
0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f,
0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67,
0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x04, 0x4e, 0x6f, 0x64,
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a,
0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x20, 0x0a,
0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12,
0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x12,
0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f,
0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_node_proto_rawDescOnce sync.Once
file_model_node_proto_rawDescData = file_model_node_proto_rawDesc
)
func file_model_node_proto_rawDescGZIP() []byte {
file_model_node_proto_rawDescOnce.Do(func() {
file_model_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_proto_rawDescData)
})
return file_model_node_proto_rawDescData
}
var file_model_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_node_proto_goTypes = []interface{}{
(*Node)(nil), // 0: pb.Node
(*NodeCluster)(nil), // 1: pb.NodeCluster
(*NodeLogin)(nil), // 2: pb.NodeLogin
}
var file_model_node_proto_depIdxs = []int32{
1, // 0: pb.Node.cluster:type_name -> pb.NodeCluster
2, // 1: pb.Node.login:type_name -> pb.NodeLogin
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_model_node_proto_init() }
func file_model_node_proto_init() {
if File_model_node_proto != nil {
return
}
file_model_node_cluster_proto_init()
file_model_node_login_proto_init()
if !protoimpl.UnsafeEnabled {
file_model_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_model_node_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_node_proto_goTypes,
DependencyIndexes: file_model_node_proto_depIdxs,
MessageInfos: file_model_node_proto_msgTypes,
}.Build()
File_model_node_proto = out.File
file_model_node_proto_rawDesc = nil
file_model_node_proto_goTypes = nil
file_model_node_proto_depIdxs = nil
}

View File

@@ -1,185 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_node_cluster.proto
package pb
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 NodeCluster struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
CreatedAt int64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
GrantId int64 `protobuf:"varint,4,opt,name=grantId,proto3" json:"grantId,omitempty"`
InstallDir string `protobuf:"bytes,5,opt,name=installDir,proto3" json:"installDir,omitempty"`
}
func (x *NodeCluster) Reset() {
*x = NodeCluster{}
if protoimpl.UnsafeEnabled {
mi := &file_model_node_cluster_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NodeCluster) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeCluster) ProtoMessage() {}
func (x *NodeCluster) ProtoReflect() protoreflect.Message {
mi := &file_model_node_cluster_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 NodeCluster.ProtoReflect.Descriptor instead.
func (*NodeCluster) Descriptor() ([]byte, []int) {
return file_model_node_cluster_proto_rawDescGZIP(), []int{0}
}
func (x *NodeCluster) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NodeCluster) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NodeCluster) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *NodeCluster) GetGrantId() int64 {
if x != nil {
return x.GrantId
}
return 0
}
func (x *NodeCluster) GetInstallDir() string {
if x != nil {
return x.InstallDir
}
return ""
}
var File_model_node_cluster_proto protoreflect.FileDescriptor
var file_model_node_cluster_proto_rawDesc = []byte{
0x0a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75,
0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x89,
0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e,
0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_node_cluster_proto_rawDescOnce sync.Once
file_model_node_cluster_proto_rawDescData = file_model_node_cluster_proto_rawDesc
)
func file_model_node_cluster_proto_rawDescGZIP() []byte {
file_model_node_cluster_proto_rawDescOnce.Do(func() {
file_model_node_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_cluster_proto_rawDescData)
})
return file_model_node_cluster_proto_rawDescData
}
var file_model_node_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_node_cluster_proto_goTypes = []interface{}{
(*NodeCluster)(nil), // 0: pb.NodeCluster
}
var file_model_node_cluster_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_model_node_cluster_proto_init() }
func file_model_node_cluster_proto_init() {
if File_model_node_cluster_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_model_node_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NodeCluster); 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_model_node_cluster_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_node_cluster_proto_goTypes,
DependencyIndexes: file_model_node_cluster_proto_depIdxs,
MessageInfos: file_model_node_cluster_proto_msgTypes,
}.Build()
File_model_node_cluster_proto = out.File
file_model_node_cluster_proto_rawDesc = nil
file_model_node_cluster_proto_goTypes = nil
file_model_node_cluster_proto_depIdxs = nil
}

View File

@@ -1,223 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_node_grant.proto
package pb
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 NodeGrant struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"`
Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
Su bool `protobuf:"varint,6,opt,name=su,proto3" json:"su,omitempty"`
PrivateKey string `protobuf:"bytes,7,opt,name=privateKey,proto3" json:"privateKey,omitempty"`
Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"`
NodeId int64 `protobuf:"varint,9,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
}
func (x *NodeGrant) Reset() {
*x = NodeGrant{}
if protoimpl.UnsafeEnabled {
mi := &file_model_node_grant_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NodeGrant) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeGrant) ProtoMessage() {}
func (x *NodeGrant) ProtoReflect() protoreflect.Message {
mi := &file_model_node_grant_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 NodeGrant.ProtoReflect.Descriptor instead.
func (*NodeGrant) Descriptor() ([]byte, []int) {
return file_model_node_grant_proto_rawDescGZIP(), []int{0}
}
func (x *NodeGrant) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NodeGrant) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NodeGrant) GetMethod() string {
if x != nil {
return x.Method
}
return ""
}
func (x *NodeGrant) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *NodeGrant) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
func (x *NodeGrant) GetSu() bool {
if x != nil {
return x.Su
}
return false
}
func (x *NodeGrant) GetPrivateKey() string {
if x != nil {
return x.PrivateKey
}
return ""
}
func (x *NodeGrant) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *NodeGrant) GetNodeId() int64 {
if x != nil {
return x.NodeId
}
return 0
}
var File_model_node_grant_proto protoreflect.FileDescriptor
var file_model_node_grant_proto_rawDesc = []byte{
0x0a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x67, 0x72, 0x61,
0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xe9, 0x01, 0x0a,
0x09, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x73, 0x75, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x73, 0x75, 0x12, 0x1e,
0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 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, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03,
0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_node_grant_proto_rawDescOnce sync.Once
file_model_node_grant_proto_rawDescData = file_model_node_grant_proto_rawDesc
)
func file_model_node_grant_proto_rawDescGZIP() []byte {
file_model_node_grant_proto_rawDescOnce.Do(func() {
file_model_node_grant_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_grant_proto_rawDescData)
})
return file_model_node_grant_proto_rawDescData
}
var file_model_node_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_node_grant_proto_goTypes = []interface{}{
(*NodeGrant)(nil), // 0: pb.NodeGrant
}
var file_model_node_grant_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_model_node_grant_proto_init() }
func file_model_node_grant_proto_init() {
if File_model_node_grant_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_model_node_grant_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NodeGrant); 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_model_node_grant_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_node_grant_proto_goTypes,
DependencyIndexes: file_model_node_grant_proto_depIdxs,
MessageInfos: file_model_node_grant_proto_msgTypes,
}.Build()
File_model_node_grant_proto = out.File
file_model_node_grant_proto_rawDesc = nil
file_model_node_grant_proto_goTypes = nil
file_model_node_grant_proto_depIdxs = nil
}

View File

@@ -1,203 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_node_ip_address.proto
package pb
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 NodeIPAddress struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
NodeId int64 `protobuf:"varint,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
State int64 `protobuf:"varint,6,opt,name=state,proto3" json:"state,omitempty"`
Order int64 `protobuf:"varint,7,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *NodeIPAddress) Reset() {
*x = NodeIPAddress{}
if protoimpl.UnsafeEnabled {
mi := &file_model_node_ip_address_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NodeIPAddress) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeIPAddress) ProtoMessage() {}
func (x *NodeIPAddress) ProtoReflect() protoreflect.Message {
mi := &file_model_node_ip_address_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 NodeIPAddress.ProtoReflect.Descriptor instead.
func (*NodeIPAddress) Descriptor() ([]byte, []int) {
return file_model_node_ip_address_proto_rawDescGZIP(), []int{0}
}
func (x *NodeIPAddress) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NodeIPAddress) GetNodeId() int64 {
if x != nil {
return x.NodeId
}
return 0
}
func (x *NodeIPAddress) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NodeIPAddress) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
func (x *NodeIPAddress) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *NodeIPAddress) GetState() int64 {
if x != nil {
return x.State
}
return 0
}
func (x *NodeIPAddress) GetOrder() int64 {
if x != nil {
return x.Order
}
return 0
}
var File_model_node_ip_address_proto protoreflect.FileDescriptor
var file_model_node_ip_address_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x5f,
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70,
0x62, 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12,
0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_node_ip_address_proto_rawDescOnce sync.Once
file_model_node_ip_address_proto_rawDescData = file_model_node_ip_address_proto_rawDesc
)
func file_model_node_ip_address_proto_rawDescGZIP() []byte {
file_model_node_ip_address_proto_rawDescOnce.Do(func() {
file_model_node_ip_address_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_ip_address_proto_rawDescData)
})
return file_model_node_ip_address_proto_rawDescData
}
var file_model_node_ip_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_node_ip_address_proto_goTypes = []interface{}{
(*NodeIPAddress)(nil), // 0: pb.NodeIPAddress
}
var file_model_node_ip_address_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_model_node_ip_address_proto_init() }
func file_model_node_ip_address_proto_init() {
if File_model_node_ip_address_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_model_node_ip_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NodeIPAddress); 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_model_node_ip_address_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_node_ip_address_proto_goTypes,
DependencyIndexes: file_model_node_ip_address_proto_depIdxs,
MessageInfos: file_model_node_ip_address_proto_msgTypes,
}.Build()
File_model_node_ip_address_proto = out.File
file_model_node_ip_address_proto_rawDesc = nil
file_model_node_ip_address_proto_goTypes = nil
file_model_node_ip_address_proto_depIdxs = nil
}

View File

@@ -1,174 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_node_login.proto
package pb
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 NodeLogin struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Params []byte `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"`
}
func (x *NodeLogin) Reset() {
*x = NodeLogin{}
if protoimpl.UnsafeEnabled {
mi := &file_model_node_login_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NodeLogin) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodeLogin) ProtoMessage() {}
func (x *NodeLogin) ProtoReflect() protoreflect.Message {
mi := &file_model_node_login_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 NodeLogin.ProtoReflect.Descriptor instead.
func (*NodeLogin) Descriptor() ([]byte, []int) {
return file_model_node_login_proto_rawDescGZIP(), []int{0}
}
func (x *NodeLogin) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NodeLogin) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NodeLogin) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *NodeLogin) GetParams() []byte {
if x != nil {
return x.Params
}
return nil
}
var File_model_node_login_proto protoreflect.FileDescriptor
var file_model_node_login_proto_rawDesc = []byte{
0x0a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67,
0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x5b, 0x0a, 0x09,
0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_node_login_proto_rawDescOnce sync.Once
file_model_node_login_proto_rawDescData = file_model_node_login_proto_rawDesc
)
func file_model_node_login_proto_rawDescGZIP() []byte {
file_model_node_login_proto_rawDescOnce.Do(func() {
file_model_node_login_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_login_proto_rawDescData)
})
return file_model_node_login_proto_rawDescData
}
var file_model_node_login_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_node_login_proto_goTypes = []interface{}{
(*NodeLogin)(nil), // 0: pb.NodeLogin
}
var file_model_node_login_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_model_node_login_proto_init() }
func file_model_node_login_proto_init() {
if File_model_node_login_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_model_node_login_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NodeLogin); 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_model_node_login_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_node_login_proto_goTypes,
DependencyIndexes: file_model_node_login_proto_depIdxs,
MessageInfos: file_model_node_login_proto_msgTypes,
}.Build()
File_model_node_login_proto = out.File
file_model_node_login_proto_rawDesc = nil
file_model_node_login_proto_goTypes = nil
file_model_node_login_proto_depIdxs = nil
}

View File

@@ -1,201 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_server.proto
package pb
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 Server struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
IncludeNodes []byte `protobuf:"bytes,3,opt,name=includeNodes,proto3" json:"includeNodes,omitempty"`
ExcludeNodes []byte `protobuf:"bytes,4,opt,name=excludeNodes,proto3" json:"excludeNodes,omitempty"`
CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Cluster *NodeCluster `protobuf:"bytes,6,opt,name=cluster,proto3" json:"cluster,omitempty"`
}
func (x *Server) Reset() {
*x = Server{}
if protoimpl.UnsafeEnabled {
mi := &file_model_server_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Server) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server) ProtoMessage() {}
func (x *Server) ProtoReflect() protoreflect.Message {
mi := &file_model_server_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 Server.ProtoReflect.Descriptor instead.
func (*Server) Descriptor() ([]byte, []int) {
return file_model_server_proto_rawDescGZIP(), []int{0}
}
func (x *Server) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *Server) GetConfig() []byte {
if x != nil {
return x.Config
}
return nil
}
func (x *Server) GetIncludeNodes() []byte {
if x != nil {
return x.IncludeNodes
}
return nil
}
func (x *Server) GetExcludeNodes() []byte {
if x != nil {
return x.ExcludeNodes
}
return nil
}
func (x *Server) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *Server) GetCluster() *NodeCluster {
if x != nil {
return x.Cluster
}
return nil
}
var File_model_server_proto protoreflect.FileDescriptor
var file_model_server_proto_rawDesc = []byte{
0x0a, 0x12, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0xc1, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a,
0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65,
0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x69, 0x6e, 0x63,
0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x65, 0x78, 0x63,
0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x0c, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1c, 0x0a,
0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x63,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70,
0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_model_server_proto_rawDescOnce sync.Once
file_model_server_proto_rawDescData = file_model_server_proto_rawDesc
)
func file_model_server_proto_rawDescGZIP() []byte {
file_model_server_proto_rawDescOnce.Do(func() {
file_model_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_server_proto_rawDescData)
})
return file_model_server_proto_rawDescData
}
var file_model_server_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_server_proto_goTypes = []interface{}{
(*Server)(nil), // 0: pb.Server
(*NodeCluster)(nil), // 1: pb.NodeCluster
}
var file_model_server_proto_depIdxs = []int32{
1, // 0: pb.Server.cluster:type_name -> pb.NodeCluster
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_model_server_proto_init() }
func file_model_server_proto_init() {
if File_model_server_proto != nil {
return
}
file_model_node_cluster_proto_init()
if !protoimpl.UnsafeEnabled {
file_model_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Server); 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_model_server_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_server_proto_goTypes,
DependencyIndexes: file_model_server_proto_depIdxs,
MessageInfos: file_model_server_proto_msgTypes,
}.Build()
File_model_server_proto = out.File
file_model_server_proto_rawDesc = nil
file_model_server_proto_goTypes = nil
file_model_server_proto_depIdxs = nil
}

View File

@@ -1,883 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_admin.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
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 LoginAdminRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
}
func (x *LoginAdminRequest) Reset() {
*x = LoginAdminRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LoginAdminRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginAdminRequest) ProtoMessage() {}
func (x *LoginAdminRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_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 LoginAdminRequest.ProtoReflect.Descriptor instead.
func (*LoginAdminRequest) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{0}
}
func (x *LoginAdminRequest) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *LoginAdminRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type LoginAdminResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AdminId int64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"`
IsOk bool `protobuf:"varint,2,opt,name=isOk,proto3" json:"isOk,omitempty"`
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *LoginAdminResponse) Reset() {
*x = LoginAdminResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LoginAdminResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginAdminResponse) ProtoMessage() {}
func (x *LoginAdminResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_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 LoginAdminResponse.ProtoReflect.Descriptor instead.
func (*LoginAdminResponse) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{1}
}
func (x *LoginAdminResponse) GetAdminId() int64 {
if x != nil {
return x.AdminId
}
return 0
}
func (x *LoginAdminResponse) GetIsOk() bool {
if x != nil {
return x.IsOk
}
return false
}
func (x *LoginAdminResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type CreateAdminLogRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"`
Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
}
func (x *CreateAdminLogRequest) Reset() {
*x = CreateAdminLogRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateAdminLogRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAdminLogRequest) ProtoMessage() {}
func (x *CreateAdminLogRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_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 CreateAdminLogRequest.ProtoReflect.Descriptor instead.
func (*CreateAdminLogRequest) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{2}
}
func (x *CreateAdminLogRequest) GetLevel() string {
if x != nil {
return x.Level
}
return ""
}
func (x *CreateAdminLogRequest) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *CreateAdminLogRequest) GetAction() string {
if x != nil {
return x.Action
}
return ""
}
func (x *CreateAdminLogRequest) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
type CreateAdminLogResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"`
}
func (x *CreateAdminLogResponse) Reset() {
*x = CreateAdminLogResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateAdminLogResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAdminLogResponse) ProtoMessage() {}
func (x *CreateAdminLogResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_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 CreateAdminLogResponse.ProtoReflect.Descriptor instead.
func (*CreateAdminLogResponse) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{3}
}
func (x *CreateAdminLogResponse) GetIsOk() bool {
if x != nil {
return x.IsOk
}
return false
}
type CheckAdminExistsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AdminId int64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"`
}
func (x *CheckAdminExistsRequest) Reset() {
*x = CheckAdminExistsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckAdminExistsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckAdminExistsRequest) ProtoMessage() {}
func (x *CheckAdminExistsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_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 CheckAdminExistsRequest.ProtoReflect.Descriptor instead.
func (*CheckAdminExistsRequest) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{4}
}
func (x *CheckAdminExistsRequest) GetAdminId() int64 {
if x != nil {
return x.AdminId
}
return 0
}
type CheckAdminExistsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *CheckAdminExistsResponse) Reset() {
*x = CheckAdminExistsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckAdminExistsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckAdminExistsResponse) ProtoMessage() {}
func (x *CheckAdminExistsResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_proto_msgTypes[5]
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 CheckAdminExistsResponse.ProtoReflect.Descriptor instead.
func (*CheckAdminExistsResponse) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{5}
}
func (x *CheckAdminExistsResponse) GetIsOk() bool {
if x != nil {
return x.IsOk
}
return false
}
func (x *CheckAdminExistsResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type FindAdminNameRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AdminId int64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"`
}
func (x *FindAdminNameRequest) Reset() {
*x = FindAdminNameRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindAdminNameRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindAdminNameRequest) ProtoMessage() {}
func (x *FindAdminNameRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_proto_msgTypes[6]
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 FindAdminNameRequest.ProtoReflect.Descriptor instead.
func (*FindAdminNameRequest) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{6}
}
func (x *FindAdminNameRequest) GetAdminId() int64 {
if x != nil {
return x.AdminId
}
return 0
}
type FindAdminNameResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"`
}
func (x *FindAdminNameResponse) Reset() {
*x = FindAdminNameResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_admin_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FindAdminNameResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FindAdminNameResponse) ProtoMessage() {}
func (x *FindAdminNameResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_admin_proto_msgTypes[7]
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 FindAdminNameResponse.ProtoReflect.Descriptor instead.
func (*FindAdminNameResponse) Descriptor() ([]byte, []int) {
return file_service_admin_proto_rawDescGZIP(), []int{7}
}
func (x *FindAdminNameResponse) GetFullname() string {
if x != nil {
return x.Fullname
}
return ""
}
var File_service_admin_proto protoreflect.FileDescriptor
var file_service_admin_proto_rawDesc = []byte{
0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x4b, 0x0a, 0x11, 0x4c, 0x6f, 0x67,
0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a,
0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61,
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61,
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x5c, 0x0a, 0x12, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41,
0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61,
0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x02,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x22, 0x77, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64,
0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a,
0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65,
0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x2c, 0x0a,
0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x22, 0x33, 0x0a, 0x17, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64,
0x22, 0x48, 0x0a, 0x18, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78,
0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x69, 0x73, 0x4f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b,
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, 0x22, 0x30, 0x0a, 0x14, 0x46, 0x69,
0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x15,
0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d,
0x65, 0x32, 0xb5, 0x02, 0x0a, 0x0c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e,
0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67,
0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x00, 0x12, 0x49, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e,
0x4c, 0x6f, 0x67, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41,
0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a,
0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c,
0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x10,
0x63, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73,
0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e,
0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69,
0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a,
0x11, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x46, 0x75, 0x6c, 0x6c, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69,
0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70,
0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_service_admin_proto_rawDescOnce sync.Once
file_service_admin_proto_rawDescData = file_service_admin_proto_rawDesc
)
func file_service_admin_proto_rawDescGZIP() []byte {
file_service_admin_proto_rawDescOnce.Do(func() {
file_service_admin_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_admin_proto_rawDescData)
})
return file_service_admin_proto_rawDescData
}
var file_service_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_service_admin_proto_goTypes = []interface{}{
(*LoginAdminRequest)(nil), // 0: pb.LoginAdminRequest
(*LoginAdminResponse)(nil), // 1: pb.LoginAdminResponse
(*CreateAdminLogRequest)(nil), // 2: pb.CreateAdminLogRequest
(*CreateAdminLogResponse)(nil), // 3: pb.CreateAdminLogResponse
(*CheckAdminExistsRequest)(nil), // 4: pb.CheckAdminExistsRequest
(*CheckAdminExistsResponse)(nil), // 5: pb.CheckAdminExistsResponse
(*FindAdminNameRequest)(nil), // 6: pb.FindAdminNameRequest
(*FindAdminNameResponse)(nil), // 7: pb.FindAdminNameResponse
}
var file_service_admin_proto_depIdxs = []int32{
0, // 0: pb.AdminService.loginAdmin:input_type -> pb.LoginAdminRequest
2, // 1: pb.AdminService.createAdminLog:input_type -> pb.CreateAdminLogRequest
4, // 2: pb.AdminService.checkAdminExists:input_type -> pb.CheckAdminExistsRequest
6, // 3: pb.AdminService.findAdminFullname:input_type -> pb.FindAdminNameRequest
1, // 4: pb.AdminService.loginAdmin:output_type -> pb.LoginAdminResponse
3, // 5: pb.AdminService.createAdminLog:output_type -> pb.CreateAdminLogResponse
5, // 6: pb.AdminService.checkAdminExists:output_type -> pb.CheckAdminExistsResponse
7, // 7: pb.AdminService.findAdminFullname:output_type -> pb.FindAdminNameResponse
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_service_admin_proto_init() }
func file_service_admin_proto_init() {
if File_service_admin_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_service_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LoginAdminRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LoginAdminResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateAdminLogRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateAdminLogResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CheckAdminExistsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CheckAdminExistsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindAdminNameRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_admin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FindAdminNameResponse); 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_service_admin_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_admin_proto_goTypes,
DependencyIndexes: file_service_admin_proto_depIdxs,
MessageInfos: file_service_admin_proto_msgTypes,
}.Build()
File_service_admin_proto = out.File
file_service_admin_proto_rawDesc = nil
file_service_admin_proto_goTypes = nil
file_service_admin_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// AdminServiceClient is the client API for AdminService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type AdminServiceClient interface {
// 登录
LoginAdmin(ctx context.Context, in *LoginAdminRequest, opts ...grpc.CallOption) (*LoginAdminResponse, error)
// 创建操作日志
CreateAdminLog(ctx context.Context, in *CreateAdminLogRequest, opts ...grpc.CallOption) (*CreateAdminLogResponse, error)
// 检查管理员是否存在
CheckAdminExists(ctx context.Context, in *CheckAdminExistsRequest, opts ...grpc.CallOption) (*CheckAdminExistsResponse, error)
// 获取管理员名称
FindAdminFullname(ctx context.Context, in *FindAdminNameRequest, opts ...grpc.CallOption) (*FindAdminNameResponse, error)
}
type adminServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient {
return &adminServiceClient{cc}
}
func (c *adminServiceClient) LoginAdmin(ctx context.Context, in *LoginAdminRequest, opts ...grpc.CallOption) (*LoginAdminResponse, error) {
out := new(LoginAdminResponse)
err := c.cc.Invoke(ctx, "/pb.AdminService/loginAdmin", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminServiceClient) CreateAdminLog(ctx context.Context, in *CreateAdminLogRequest, opts ...grpc.CallOption) (*CreateAdminLogResponse, error) {
out := new(CreateAdminLogResponse)
err := c.cc.Invoke(ctx, "/pb.AdminService/createAdminLog", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminServiceClient) CheckAdminExists(ctx context.Context, in *CheckAdminExistsRequest, opts ...grpc.CallOption) (*CheckAdminExistsResponse, error) {
out := new(CheckAdminExistsResponse)
err := c.cc.Invoke(ctx, "/pb.AdminService/checkAdminExists", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminServiceClient) FindAdminFullname(ctx context.Context, in *FindAdminNameRequest, opts ...grpc.CallOption) (*FindAdminNameResponse, error) {
out := new(FindAdminNameResponse)
err := c.cc.Invoke(ctx, "/pb.AdminService/findAdminFullname", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AdminServiceServer is the server API for AdminService service.
type AdminServiceServer interface {
// 登录
LoginAdmin(context.Context, *LoginAdminRequest) (*LoginAdminResponse, error)
// 创建操作日志
CreateAdminLog(context.Context, *CreateAdminLogRequest) (*CreateAdminLogResponse, error)
// 检查管理员是否存在
CheckAdminExists(context.Context, *CheckAdminExistsRequest) (*CheckAdminExistsResponse, error)
// 获取管理员名称
FindAdminFullname(context.Context, *FindAdminNameRequest) (*FindAdminNameResponse, error)
}
// UnimplementedAdminServiceServer can be embedded to have forward compatible implementations.
type UnimplementedAdminServiceServer struct {
}
func (*UnimplementedAdminServiceServer) LoginAdmin(context.Context, *LoginAdminRequest) (*LoginAdminResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LoginAdmin not implemented")
}
func (*UnimplementedAdminServiceServer) CreateAdminLog(context.Context, *CreateAdminLogRequest) (*CreateAdminLogResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateAdminLog not implemented")
}
func (*UnimplementedAdminServiceServer) CheckAdminExists(context.Context, *CheckAdminExistsRequest) (*CheckAdminExistsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckAdminExists not implemented")
}
func (*UnimplementedAdminServiceServer) FindAdminFullname(context.Context, *FindAdminNameRequest) (*FindAdminNameResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindAdminFullname not implemented")
}
func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer) {
s.RegisterService(&_AdminService_serviceDesc, srv)
}
func _AdminService_LoginAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginAdminRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServiceServer).LoginAdmin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.AdminService/LoginAdmin",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServiceServer).LoginAdmin(ctx, req.(*LoginAdminRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AdminService_CreateAdminLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateAdminLogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServiceServer).CreateAdminLog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.AdminService/CreateAdminLog",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServiceServer).CreateAdminLog(ctx, req.(*CreateAdminLogRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AdminService_CheckAdminExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckAdminExistsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServiceServer).CheckAdminExists(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.AdminService/CheckAdminExists",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServiceServer).CheckAdminExists(ctx, req.(*CheckAdminExistsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AdminService_FindAdminFullname_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindAdminNameRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServiceServer).FindAdminFullname(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.AdminService/FindAdminFullname",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServiceServer).FindAdminFullname(ctx, req.(*FindAdminNameRequest))
}
return interceptor(ctx, in, info, handler)
}
var _AdminService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.AdminService",
HandlerType: (*AdminServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "loginAdmin",
Handler: _AdminService_LoginAdmin_Handler,
},
{
MethodName: "createAdminLog",
Handler: _AdminService_CreateAdminLog_Handler,
},
{
MethodName: "checkAdminExists",
Handler: _AdminService_CheckAdminExists_Handler,
},
{
MethodName: "findAdminFullname",
Handler: _AdminService_FindAdminFullname_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_admin.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,66 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_log.proto
package pb
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_service_log_proto protoreflect.FileDescriptor
var file_service_log_proto_rawDesc = []byte{
0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_service_log_proto_goTypes = []interface{}{}
var file_service_log_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_service_log_proto_init() }
func file_service_log_proto_init() {
if File_service_log_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_log_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_service_log_proto_goTypes,
DependencyIndexes: file_service_log_proto_depIdxs,
}.Build()
File_service_log_proto = out.File
file_service_log_proto_rawDesc = nil
file_service_log_proto_goTypes = nil
file_service_log_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,66 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_node_group.proto
package pb
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_service_node_group_proto protoreflect.FileDescriptor
var file_service_node_group_proto_rawDesc = []byte{
0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x67,
0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_service_node_group_proto_goTypes = []interface{}{}
var file_service_node_group_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_service_node_group_proto_init() }
func file_service_node_group_proto_init() {
if File_service_node_group_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_node_group_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_service_node_group_proto_goTypes,
DependencyIndexes: file_service_node_group_proto_depIdxs,
}.Build()
File_service_node_group_proto = out.File
file_service_node_group_proto_rawDesc = nil
file_service_node_group_proto_goTypes = nil
file_service_node_group_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,66 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_node_region.proto
package pb
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_service_node_region_proto protoreflect.FileDescriptor
var file_service_node_region_proto_rawDesc = []byte{
0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x72,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_service_node_region_proto_goTypes = []interface{}{}
var file_service_node_region_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_service_node_region_proto_init() }
func file_service_node_region_proto_init() {
if File_service_node_region_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_node_region_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_service_node_region_proto_goTypes,
DependencyIndexes: file_service_node_region_proto_depIdxs,
}.Build()
File_service_node_region_proto = out.File
file_service_node_region_proto_rawDesc = nil
file_service_node_region_proto_goTypes = nil
file_service_node_region_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,66 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_server_group.proto
package pb
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_service_server_group_proto protoreflect.FileDescriptor
var file_service_server_group_proto_rawDesc = []byte{
0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_service_server_group_proto_goTypes = []interface{}{}
var file_service_server_group_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_service_server_group_proto_init() }
func file_service_server_group_proto_init() {
if File_service_server_group_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_server_group_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_service_server_group_proto_goTypes,
DependencyIndexes: file_service_server_group_proto_depIdxs,
}.Build()
File_service_server_group_proto = out.File
file_service_server_group_proto_rawDesc = nil
file_service_server_group_proto_goTypes = nil
file_service_server_group_proto_depIdxs = nil
}

View File

@@ -1,66 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_user.proto
package pb
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_service_user_proto protoreflect.FileDescriptor
var file_service_user_proto_rawDesc = []byte{
0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_service_user_proto_goTypes = []interface{}{}
var file_service_user_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_service_user_proto_init() }
func file_service_user_proto_init() {
if File_service_user_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_user_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_service_user_proto_goTypes,
DependencyIndexes: file_service_user_proto_depIdxs,
}.Build()
File_service_user_proto = out.File
file_service_user_proto_rawDesc = nil
file_service_user_proto_goTypes = nil
file_service_user_proto_depIdxs = nil
}

View File

@@ -1,16 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message APINode {
int64 id = 1;
bool isOn = 2;
int64 clusterId = 3;
string uniqueId = 4;
string secret = 5;
string name = 6;
string description = 7;
string host = 8;
int32 port = 9;
}

View File

@@ -1,21 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_node_cluster.proto";
import "model_node_login.proto";
message Node {
int64 id = 1;
string name = 2;
string status = 3;
string installDir = 4;
bool isInstalled = 5;
string code = 6;
string uniqueId = 7;
string secret = 8;
NodeCluster cluster = 32;
NodeLogin login = 33;
}

View File

@@ -1,12 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeCluster {
int64 id = 1;
string name = 2;
int64 createdAt = 3;
int64 grantId = 4;
string installDir = 5;
}

View File

@@ -1,16 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeGrant {
int64 id = 1;
string name = 2;
string method = 3;
string username = 4;
string password = 5;
bool su = 6;
string privateKey = 7;
string description = 8;
int64 nodeId = 9;
}

View File

@@ -1,14 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeIPAddress {
int64 id = 1;
int64 nodeId = 2;
string name = 3;
string ip = 4;
string description = 5;
int64 state = 6;
int64 order = 7;
}

View File

@@ -1,11 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodeLogin {
int64 id = 1;
string name = 2;
string type = 3;
bytes params = 4;
}

View File

@@ -1,16 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_node_cluster.proto";
message Server {
int64 id = 1;
bytes config = 2;
bytes includeNodes = 3;
bytes excludeNodes = 4;
int64 createdAt = 5;
NodeCluster cluster = 6;
}

View File

@@ -1,65 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
service AdminService {
// 登录
rpc loginAdmin (LoginAdminRequest) returns (LoginAdminResponse) {
}
// 创建操作日志
rpc createAdminLog (CreateAdminLogRequest) returns (CreateAdminLogResponse) {
}
// 检查管理员是否存在
rpc checkAdminExists (CheckAdminExistsRequest) returns (CheckAdminExistsResponse) {
}
// 获取管理员名称
rpc findAdminFullname (FindAdminNameRequest) returns (FindAdminNameResponse) {
}
}
message LoginAdminRequest {
string username = 1;
string password = 2;
}
message LoginAdminResponse {
int64 adminId = 1;
bool isOk = 2;
string message = 3;
}
message CreateAdminLogRequest {
string level = 1;
string description = 2;
string action = 3;
string ip = 4;
}
message CreateAdminLogResponse {
bool isOk = 1;
}
message CheckAdminExistsRequest {
int64 adminId = 1;
}
message CheckAdminExistsResponse {
bool isOk = 1;
string message = 2;
}
message FindAdminNameRequest {
int64 adminId = 1;
}
message FindAdminNameResponse {
string fullname = 1;
}

View File

@@ -1,99 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_api_node.proto";
service APINodeService {
// 创建API节点
rpc createAPINode (CreateAPINodeRequest) returns (CreateAPINodeResponse);
// 修改API节点
rpc updateAPINode (UpdateAPINodeRequest) returns (UpdateAPINodeResponse);
// 删除API节点
rpc deleteAPINode (DeleteAPINodeRequest) returns (DeleteAPINodeResponse);
// 列出所有可用API节点
rpc findAllEnabledAPINodes (FindAllEnabledAPINodesRequest) returns (FindAllEnabledAPINodesResponse);
// 计算API节点数量
rpc countAllEnabledAPINodes (CountAllEnabledAPINodesRequest) returns (CountAllEnabledAPINodesResponse);
// 列出单页的API节点
rpc listEnabledAPINodes (ListEnabledAPINodesRequest) returns (ListEnabledAPINodesResponse);
// 根据ID查找节点
rpc findEnabledAPINode (FindEnabledAPINodeRequest) returns (FindEnabledAPINodeResponse);
}
// 创建API节点
message CreateAPINodeRequest {
string name = 1;
string description = 2;
string host = 3;
int32 port = 4;
}
message CreateAPINodeResponse {
int64 nodeId = 1;
}
// 修改API节点
message UpdateAPINodeRequest {
int64 nodeId = 1;
string name = 2;
string description = 3;
string host = 4;
int32 port = 5;
}
message UpdateAPINodeResponse {
}
// 删除API节点
message DeleteAPINodeRequest {
int64 nodeId = 1;
}
message DeleteAPINodeResponse {
}
// 列出所有可用API节点
message FindAllEnabledAPINodesRequest {
}
message FindAllEnabledAPINodesResponse {
repeated APINode nodes = 1;
}
// 计算API节点数量
message CountAllEnabledAPINodesRequest {
}
message CountAllEnabledAPINodesResponse {
int64 count = 1;
}
// 列出单页的API节点
message ListEnabledAPINodesRequest {
int64 offset = 1;
int64 size = 2;
}
message ListEnabledAPINodesResponse {
repeated APINode nodes = 1;
}
// 根据ID查找节点
message FindEnabledAPINodeRequest {
int64 nodeId = 1;
}
message FindEnabledAPINodeResponse {
APINode node = 1;
}

View File

@@ -1,5 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;

View File

@@ -1,160 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_node.proto";
import "model_node_login.proto";
service NodeService {
// 创建节点
rpc createNode (CreateNodeRequest) returns (CreateNodeResponse);
// 节点数量
rpc countAllEnabledNodes (CountAllEnabledNodesRequest) returns (CountAllEnabledNodesResponse);
// 计算匹配的节点数量
rpc countAllEnabledNodesMatch (CountAllEnabledNodesMatchRequest) returns (CountAllEnabledNodesMatchResponse);
// 列出单页节点
rpc listEnabledNodesMatch (ListEnabledNodesMatchRequest) returns (ListEnabledNodesMatchResponse);
// 禁用节点
rpc disableNode (DisableNodeRequest) returns (DisableNodeResponse);
// 修改节点
rpc updateNode (UpdateNodeRequest) returns (UpdateNodeResponse);
// 查看单个节点
rpc findEnabledNode (FindEnabledNodeRequest) returns (FindEnabledNodeResponse);
// 组合单个节点配置
rpc composeNodeConfig (ComposeNodeConfigRequest) returns (ComposeNodeConfigResponse);
// 节点stream
rpc nodeStream (stream NodeStreamRequest) returns (stream NodeStreamResponse);
// 更新节点状态
rpc updateNodeStatus (UpdateNodeStatusRequest) returns (UpdateNodeStatusResponse);
// 同步集群中的节点版本
rpc syncNodesVersionWithCluster (SyncNodesVersionWithClusterRequest) returns (SyncNodesVersionWithClusterResponse);
// 修改节点安装状态
rpc updateNodeIsInstalled (UpdateNodeIsInstalledRequest) returns (UpdateNodeIsInstalledResponse);
}
// 创建节点
message CreateNodeRequest {
string name = 1;
int64 clusterId = 2;
NodeLogin Login = 3;
}
message CreateNodeResponse {
int64 nodeId = 1;
}
// 节点数量
message CountAllEnabledNodesRequest {
}
message CountAllEnabledNodesResponse {
int64 count = 1;
}
// 列出单页节点
message ListEnabledNodesMatchRequest {
int64 offset = 1;
int64 size = 2;
int64 clusterId = 3;
}
message ListEnabledNodesMatchResponse {
repeated Node nodes = 1;
}
// 禁用节点
message DisableNodeRequest {
int64 nodeId = 1;
}
message DisableNodeResponse {
}
// 修改节点
message UpdateNodeRequest {
int64 nodeId = 1;
string name = 2;
int64 clusterId = 3;
NodeLogin Login = 4;
}
message UpdateNodeResponse {
}
// 查找节点
message FindEnabledNodeRequest {
int64 nodeId = 1;
}
message FindEnabledNodeResponse {
Node node = 1;
}
// 组合单个节点配置
message ComposeNodeConfigRequest {
}
message ComposeNodeConfigResponse {
bytes configJSON = 1;
}
// 节点stream
message NodeStreamRequest {
}
message NodeStreamResponse {
}
// 更新节点状态
message UpdateNodeStatusRequest {
int64 nodeId = 1;
bytes statusJSON = 2;
}
message UpdateNodeStatusResponse {
}
// 同步集群中的节点版本
message SyncNodesVersionWithClusterRequest {
int64 clusterId = 1;
}
message SyncNodesVersionWithClusterResponse {
}
// 计算匹配的节点数量
message CountAllEnabledNodesMatchRequest {
int64 clusterId = 1;
}
message CountAllEnabledNodesMatchResponse {
int64 count = 1;
}
// 修改节点安装状态
message UpdateNodeIsInstalledRequest {
int64 nodeId = 1;
bool isInstalled = 2;
}
message UpdateNodeIsInstalledResponse {
}

View File

@@ -1,109 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_node_cluster.proto";
service NodeClusterService {
// 创建集群
rpc createNodeCluster (CreateNodeClusterRequest) returns (CreateNodeClusterResponse);
// 修改集群
rpc updateNodeCluster (UpdateNodeClusterRequest) returns (UpdateNodeClusterResponse);
// 禁用集群
rpc disableNodeCluster (DisableNodeClusterRequest) returns (DisableNodeClusterResponse);
// 查找单个集群信息
rpc findEnabledNodeCluster (FindEnabledNodeClusterRequest) returns (FindEnabledNodeClusterResponse);
// 获取所有集群的信息
rpc findAllEnabledNodeClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse);
// 获取变更的集群
rpc findAllChangedNodeClusters (FindAllChangedNodeClustersRequest) returns (FindAllChangedNodeClustersResponse);
// 计算所有集群数量
rpc countAllEnabledNodeClusters (CountAllEnabledNodeClustersRequest) returns (CountAllEnabledNodeClustersResponse);
// 列出单页集群
rpc listEnabledNodeClusters (ListEnabledNodeClustersRequest) returns (ListEnabledNodeClustersResponse);
}
// 获取所有集群的信息
message FindAllEnabledNodeClustersRequest {
}
message FindAllEnabledNodeClustersResponse {
repeated NodeCluster clusters = 1;
}
// 获取变更的集群
message FindAllChangedNodeClustersRequest {
}
message FindAllChangedNodeClustersResponse {
repeated NodeCluster clusters = 1;
}
// 创建集群
message CreateNodeClusterRequest {
string name = 1;
int64 grantId = 2;
string installDir = 3;
}
message CreateNodeClusterResponse {
int64 clusterId = 1;
}
// 修改集群
message UpdateNodeClusterRequest {
int64 clusterId = 1;
string name = 2;
int64 grantId = 3;
string installDir = 4;
}
message UpdateNodeClusterResponse {
}
// 禁用集群
message DisableNodeClusterRequest {
int64 clusterId = 1;
}
message DisableNodeClusterResponse {
}
// 查找单个集群信息
message FindEnabledNodeClusterRequest {
int64 clusterId = 1;
}
message FindEnabledNodeClusterResponse {
NodeCluster cluster = 1;
}
// 计算所有集群数量
message CountAllEnabledNodeClustersRequest {
}
message CountAllEnabledNodeClustersResponse {
int64 count = 1;
}
// 列出单页集群
message ListEnabledNodeClustersRequest {
int64 offset = 1;
int64 size = 2;
}
message ListEnabledNodeClustersResponse {
repeated NodeCluster clusters = 1;
}

View File

@@ -1,105 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_node_grant.proto";
service NodeGrantService {
// 创建认证
rpc createNodeGrant (CreateNodeGrantRequest) returns (CreateNodeGrantResponse);
// 修改认证
rpc updateNodeGrant (UpdateNodeGrantRequest) returns (UpdateNodeGrantResponse);
// 禁用认证
rpc disableNodeGrant (DisableNodeGrantRequest) returns (DisableNodeGrantResponse);
// 计算认证的数量
rpc countAllEnabledNodeGrants (CountAllEnabledNodeGrantsRequest) returns (CountAllEnabledNodeGrantsResponse);
// 列出单页认证
rpc ListEnabledNodeGrants (ListEnabledNodeGrantsRequest) returns (ListEnabledNodeGrantsResponse);
// 列出所有认证
rpc FindAllEnabledNodeGrants(FindAllEnabledNodeGrantsRequest) returns (FindAllEnabledNodeGrantsResponse);
// 获取单个认证信息
rpc FindEnabledGrant(FindEnabledGrantRequest) returns (FindEnabledGrantResponse);
}
// 创建节点认证
message CreateNodeGrantRequest {
string name = 1;
string method = 2;
string username = 3;
string password = 4;
string privateKey = 5;
string description = 6;
int64 nodeId = 7;
}
message CreateNodeGrantResponse {
int64 grantId = 1;
}
// 修改节点认证
message UpdateNodeGrantRequest {
int64 grantId = 8;
string name = 1;
string method = 2;
string username = 3;
string password = 4;
string privateKey = 5;
string description = 6;
int64 nodeId = 7;
}
message UpdateNodeGrantResponse {
}
// 禁用节点认证
message DisableNodeGrantRequest {
int64 grantId = 1;
}
message DisableNodeGrantResponse {
}
// 计算节点认证数量
message CountAllEnabledNodeGrantsRequest {
}
message CountAllEnabledNodeGrantsResponse {
int64 count = 1;
}
// 列出单页认证
message ListEnabledNodeGrantsRequest {
int64 offset = 1;
int64 size = 2;
}
message ListEnabledNodeGrantsResponse {
repeated NodeGrant grants = 1;
}
// 获取所有认证信息
message FindAllEnabledNodeGrantsRequest {
}
message FindAllEnabledNodeGrantsResponse {
repeated NodeGrant grants = 1;
}
// 获取认证信息
message FindEnabledGrantRequest {
int64 grantId = 1;
}
message FindEnabledGrantResponse {
NodeGrant grant = 1;
}

View File

@@ -1,5 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;

View File

@@ -1,97 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_node_ip_address.proto";
service NodeIPAddressService {
// 创建IP地址
rpc createNodeIPAddress (CreateNodeIPAddressRequest) returns (CreateNodeIPAddressResponse);
// 修改IP地址
rpc updateNodeIPAddress (UpdateNodeIPAddressRequest) returns (UpdateNodeIPAddressResponse);
// 修改IP地址所属节点
rpc updateNodeIPAddressNodeId (UpdateNodeIPAddressNodeIdRequest) returns (UpdateNodeIPAddressNodeIdResponse);
// 禁用单个IP地址
rpc disableNodeIPAddress (DisableNodeIPAddressRequest) returns (DisableNodeIPAddressResponse);
// 禁用节点的所有IP地址
rpc disableAllIPAddressesWithNodeId (DisableAllIPAddressesWithNodeIdRequest) returns (DisableAllIPAddressesWithNodeIdResponse);
// 查找单个IP地址
rpc findEnabledNodeIPAddress (FindEnabledNodeIPAddressRequest) returns (FindEnabledNodeIPAddressResponse);
// 查找节点的所有地址
rpc findAllEnabledIPAddressesWithNodeId (FindAllEnabledIPAddressesWithNodeIdRequest) returns (FindAllEnabledIPAddressesWithNodeIdResponse);
}
// 创建IP地址
message CreateNodeIPAddressRequest {
int64 nodeId = 1;
string name = 2;
string ip = 3;
}
message CreateNodeIPAddressResponse {
int64 addressId = 1;
}
// 修改IP地址
message UpdateNodeIPAddressRequest {
int64 addressId = 1;
string name = 2;
string ip = 3;
}
message UpdateNodeIPAddressResponse {
}
// 修改IP地址所属节点
message UpdateNodeIPAddressNodeIdRequest {
int64 addressId = 1;
int64 nodeId = 2;
}
message UpdateNodeIPAddressNodeIdResponse {
}
// 禁用单个IP地址
message DisableNodeIPAddressRequest {
int64 addressId = 1;
}
message DisableNodeIPAddressResponse {
}
// 禁用节点的所有IP地址
message DisableAllIPAddressesWithNodeIdRequest {
int64 nodeId = 1;
}
message DisableAllIPAddressesWithNodeIdResponse {
}
// 查找单个IP地址
message FindEnabledNodeIPAddressRequest {
int64 addressId = 1;
}
message FindEnabledNodeIPAddressResponse {
NodeIPAddress ipAddress = 1;
}
// 查找节点的所有地址
message FindAllEnabledIPAddressesWithNodeIdRequest {
int64 nodeId = 1;
}
message FindAllEnabledIPAddressesWithNodeIdResponse {
repeated NodeIPAddress addresses = 1;
}

View File

@@ -1,5 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;

View File

@@ -1,91 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "model_server.proto";
service ServerService {
// 创建服务
rpc createServer (CreateServerRequest) returns (CreateServerResponse);
// 修改服务
rpc updateServer (UpdateServerRequest) returns (UpdateServerResponse);
// 计算服务数量
rpc countAllEnabledServers (CountAllEnabledServersRequest) returns (CountAllEnabledServersResponse);
// 列出单页服务
rpc listEnabledServers (ListEnabledServersRequest) returns (ListEnabledServersResponse);
// 禁用某服务
rpc disableServer (DisableServerRequest) returns (DisableServerResponse);
// 查找单个服务
rpc findEnabledServer (FindEnabledServerRequest) returns (FindEnabledServerResponse);
}
// 创建服务
message CreateServerRequest {
int64 userId = 1;
int64 adminId = 2;
int64 clusterId = 6;
bytes config = 3;
bytes includeNodesJSON = 4;
bytes excludeNodesJSON = 5;
}
message CreateServerResponse {
int64 serverId = 1;
}
// 修改服务
message UpdateServerRequest {
int64 serverId = 1;
int64 userId = 2;
int64 adminId = 3;
int64 clusterId = 4;
bytes config = 5;
bytes includeNodesJSON = 6;
bytes excludeNodesJSON = 7;
}
message UpdateServerResponse {
}
// 计算服务数量
message CountAllEnabledServersRequest {
}
message CountAllEnabledServersResponse {
int64 count = 1;
}
// 列出单页服务
message ListEnabledServersRequest {
int64 offset = 1;
int64 size = 2;
}
message ListEnabledServersResponse {
repeated Server servers = 1;
}
// 禁用服务
message DisableServerRequest {
int64 serverId = 1;
}
message DisableServerResponse {
}
// 查找单个服务
message FindEnabledServerRequest {
int64 serverId = 1;
}
message FindEnabledServerResponse {
Server server = 1;
}

View File

@@ -1,5 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;

View File

@@ -1,5 +0,0 @@
syntax = "proto3";
option go_package = "./pb";
package pb;

View File

@@ -3,9 +3,9 @@ package services
import (
"context"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeAPI/internal/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type AdminService struct {
@@ -79,7 +79,7 @@ func (this *AdminService) CheckAdminExists(ctx context.Context, req *pb.CheckAdm
}, nil
}
func (this *AdminService) FindAdminFullname(ctx context.Context, req *pb.FindAdminNameRequest) (*pb.FindAdminNameResponse, error) {
func (this *AdminService) FindAdminFullname(ctx context.Context, req *pb.FindAdminFullnameRequest) (*pb.FindAdminFullnameResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx)
if err != nil {
return nil, err
@@ -91,7 +91,7 @@ func (this *AdminService) FindAdminFullname(ctx context.Context, req *pb.FindAdm
return nil, err
}
return &pb.FindAdminNameResponse{
return &pb.FindAdminFullnameResponse{
Fullname: fullname,
}, nil
}
}

View File

@@ -5,7 +5,7 @@ import (
"encoding/base64"
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
"github.com/TeaOSLab/EdgeAPI/internal/encrypt"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/assert"
"github.com/iwind/TeaGo/maps"
stringutil "github.com/iwind/TeaGo/utils/string"
@@ -19,7 +19,7 @@ func TestAdminService_Login(t *testing.T) {
service := &AdminService{
debug: true,
}
resp, err := service.Login(testCtx(t), &pb.AdminLoginRequest{
resp, err := service.LoginAdmin(testCtx(t), &pb.LoginAdminRequest{
Username: "admin",
Password: stringutil.Md5("123456"),
})
@@ -32,7 +32,7 @@ func TestAdminService_Login(t *testing.T) {
func TestAdminService_CreateLog(t *testing.T) {
service := &AdminService{debug: true}
resp, err := service.CreateLog(testCtx(t), &pb.AdminCreateLogRequest{
resp, err := service.CreateAdminLog(testCtx(t), &pb.CreateAdminLogRequest{
Level: "info",
Description: "这是一个测试日志",
Action: "/login",
@@ -44,11 +44,11 @@ func TestAdminService_CreateLog(t *testing.T) {
t.Log(resp)
}
func TestAdminService_FindAllEnabledClusters(t *testing.T) {
func TestAdminService_FindAdminFullname(t *testing.T) {
service := &AdminService{
debug: true,
}
resp, err := service.FindAllEnabledClusters(testCtx(t), &pb.AdminFindAllEnabledClustersRequest{})
resp, err := service.FindAdminFullname(testCtx(t), &pb.FindAdminFullnameRequest{AdminId: 1})
if err != nil {
t.Fatal(err)
}

View File

@@ -3,8 +3,8 @@ package services
import (
"context"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type APINodeService struct {
@@ -79,6 +79,7 @@ func (this *APINodeService) FindAllEnabledAPINodes(ctx context.Context, req *pb.
Description: node.Description,
Host: node.Host,
Port: int32(node.Port),
Address: node.Address(),
})
}
@@ -124,6 +125,7 @@ func (this *APINodeService) ListEnabledAPINodes(ctx context.Context, req *pb.Lis
Description: node.Description,
Host: node.Host,
Port: int32(node.Port),
Address: node.Address(),
})
}
@@ -156,6 +158,7 @@ func (this *APINodeService) FindEnabledAPINode(ctx context.Context, req *pb.Find
Description: node.Description,
Host: node.Host,
Port: int32(node.Port),
Address: node.Address(),
}
return &pb.FindEnabledAPINodeResponse{Node: result}, nil
}

View File

@@ -5,15 +5,18 @@ import (
"encoding/json"
"errors"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
"github.com/TeaOSLab/EdgeAPI/internal/installers"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/logs"
"github.com/iwind/TeaGo/maps"
"github.com/iwind/TeaGo/types"
)
type NodeService struct {
}
// 创建节点
func (this *NodeService) CreateNode(ctx context.Context, req *pb.CreateNodeRequest) (*pb.CreateNodeResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
@@ -38,6 +41,7 @@ func (this *NodeService) CreateNode(ctx context.Context, req *pb.CreateNodeReque
}, nil
}
// 计算节点数量
func (this *NodeService) CountAllEnabledNodes(ctx context.Context, req *pb.CountAllEnabledNodesRequest) (*pb.CountAllEnabledNodesResponse, error) {
_ = req
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
@@ -58,19 +62,20 @@ func (this *NodeService) CountAllEnabledNodesMatch(ctx context.Context, req *pb.
if err != nil {
return nil, err
}
count, err := models.SharedNodeDAO.CountAllEnabledNodesMatch(req.ClusterId)
count, err := models.SharedNodeDAO.CountAllEnabledNodesMatch(req.ClusterId, types.Int8(req.InstallState))
if err != nil {
return nil, err
}
return &pb.CountAllEnabledNodesMatchResponse{Count: count}, nil
}
// 列出单页的节点
func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.ListEnabledNodesMatchRequest) (*pb.ListEnabledNodesMatchResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
}
nodes, err := models.SharedNodeDAO.ListEnabledNodesMatch(req.Offset, req.Size, req.ClusterId)
nodes, err := models.SharedNodeDAO.ListEnabledNodesMatch(req.Offset, req.Size, req.ClusterId, types.Int8(req.InstallState))
if err != nil {
return nil, err
}
@@ -82,14 +87,32 @@ func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.List
return nil, err
}
// 安装信息
installStatus, err := node.DecodeInstallStatus()
if err != nil {
return nil, err
}
installStatusResult := &pb.NodeInstallStatus{}
if installStatus != nil {
installStatusResult = &pb.NodeInstallStatus{
IsRunning: installStatus.IsRunning,
IsFinished: installStatus.IsFinished,
IsOk: installStatus.IsOk,
Error: installStatus.Error,
UpdatedAt: installStatus.UpdatedAt,
}
}
result = append(result, &pb.Node{
Id: int64(node.Id),
Name: node.Name,
Status: node.Status,
Id: int64(node.Id),
Name: node.Name,
IsInstalled: node.IsInstalled == 1,
Status: node.Status,
Cluster: &pb.NodeCluster{
Id: int64(node.ClusterId),
Name: clusterName,
},
InstallStatus: installStatusResult,
})
}
@@ -183,6 +206,22 @@ func (this *NodeService) FindEnabledNode(ctx context.Context, req *pb.FindEnable
}
}
// 安装信息
installStatus, err := node.DecodeInstallStatus()
if err != nil {
return nil, err
}
installStatusResult := &pb.NodeInstallStatus{}
if installStatus != nil {
installStatusResult = &pb.NodeInstallStatus{
IsRunning: installStatus.IsRunning,
IsFinished: installStatus.IsFinished,
IsOk: installStatus.IsOk,
Error: installStatus.Error,
UpdatedAt: installStatus.UpdatedAt,
}
}
return &pb.FindEnabledNodeResponse{Node: &pb.Node{
Id: int64(node.Id),
Name: node.Name,
@@ -195,7 +234,8 @@ func (this *NodeService) FindEnabledNode(ctx context.Context, req *pb.FindEnable
Id: int64(node.ClusterId),
Name: clusterName,
},
Login: respLogin,
Login: respLogin,
InstallStatus: installStatusResult,
}}, nil
}
@@ -323,3 +363,20 @@ func (this *NodeService) UpdateNodeIsInstalled(ctx context.Context, req *pb.Upda
return &pb.UpdateNodeIsInstalledResponse{}, nil
}
// 安装节点
func (this *NodeService) InstallNode(ctx context.Context, req *pb.InstallNodeRequest) (*pb.InstallNodeResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
}
go func() {
err = installers.SharedQueue().InstallNodeProcess(req.NodeId)
if err != nil {
logs.Println("[RPC]install node:" + err.Error())
}
}()
return &pb.InstallNodeResponse{}, nil
}

View File

@@ -3,8 +3,8 @@ package services
import (
"context"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type NodeClusterService struct {

View File

@@ -4,8 +4,8 @@ import (
"context"
"errors"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type NodeGrantService struct {

View File

@@ -3,8 +3,8 @@ package services
import (
"context"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type NodeIPAddressService struct {

View File

@@ -0,0 +1,95 @@
package services
import (
"context"
"errors"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/maps"
)
// 源站相关管理
type OriginServerService struct {
}
// 创建源站
func (this *OriginServerService) CreateOriginServer(ctx context.Context, req *pb.CreateOriginServerRequest) (*pb.CreateOriginServerResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
}
if req.Addr == nil {
return nil, errors.New("'addr' can not be nil")
}
addrMap := maps.Map{
"protocol": req.Addr.Protocol,
"portRange": req.Addr.PortRange,
"host": req.Addr.Host,
}
originId, err := models.SharedOriginServerDAO.CreateOriginServer(req.Name, string(addrMap.AsJSON()), req.Description)
if err != nil {
return nil, err
}
return &pb.CreateOriginServerResponse{OriginId: originId}, nil
}
// 修改源站
func (this *OriginServerService) UpdateOriginServer(ctx context.Context, req *pb.UpdateOriginServerRequest) (*pb.UpdateOriginServerResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
}
if req.Addr == nil {
return nil, errors.New("'addr' can not be nil")
}
addrMap := maps.Map{
"protocol": req.Addr.Protocol,
"portRange": req.Addr.PortRange,
"host": req.Addr.Host,
}
err = models.SharedOriginServerDAO.UpdateOriginServer(req.OriginId, req.Name, string(addrMap.AsJSON()), req.Description)
if err != nil {
return nil, err
}
return &pb.UpdateOriginServerResponse{}, nil
}
// 查找单个源站信息
func (this *OriginServerService) FindEnabledOriginServer(ctx context.Context, req *pb.FindEnabledOriginServerRequest) (*pb.FindEnabledOriginServerResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
}
origin, err := models.SharedOriginServerDAO.FindEnabledOriginServer(req.OriginId)
if err != nil {
return nil, err
}
if origin == nil {
return &pb.FindEnabledOriginServerResponse{Origin: nil}, nil
}
addr, err := origin.DecodeAddr()
if err != nil {
return nil, err
}
result := &pb.OriginServer{
Id: int64(origin.Id),
IsOn: origin.IsOn == 1,
Name: origin.Name,
Addr: &pb.NetworkAddress{
Protocol: addr.Protocol,
Host: addr.Host,
PortRange: addr.PortRange,
},
Description: origin.Description,
}
return &pb.FindEnabledOriginServerResponse{Origin: result}, nil
}

View File

@@ -4,8 +4,8 @@ import (
"context"
"errors"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type ServerService struct {
@@ -17,7 +17,7 @@ func (this *ServerService) CreateServer(ctx context.Context, req *pb.CreateServe
if err != nil {
return nil, err
}
serverId, err := models.SharedServerDAO.CreateServer(req.AdminId, req.UserId, req.ClusterId, string(req.Config), string(req.IncludeNodesJSON), string(req.ExcludeNodesJSON))
serverId, err := models.SharedServerDAO.CreateServer(req.AdminId, req.UserId, req.Type, req.Name, req.Description, req.ClusterId, string(req.Config), string(req.IncludeNodesJSON), string(req.ExcludeNodesJSON))
if err != nil {
return nil, err
}
@@ -32,7 +32,7 @@ func (this *ServerService) CreateServer(ctx context.Context, req *pb.CreateServe
}
// 修改服务
func (this *ServerService) UpdateServer(ctx context.Context, req *pb.UpdateServerRequest) (*pb.UpdateServerResponse, error) {
func (this *ServerService) UpdateServerBasic(ctx context.Context, req *pb.UpdateServerBasicRequest) (*pb.UpdateServerBasicResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
@@ -51,7 +51,7 @@ func (this *ServerService) UpdateServer(ctx context.Context, req *pb.UpdateServe
return nil, errors.New("can not find server")
}
err = models.SharedServerDAO.UpdateServer(req.ServerId, req.ClusterId, string(req.Config), string(req.IncludeNodesJSON), string(req.ExcludeNodesJSON))
err = models.SharedServerDAO.UpdateServerBasic(req.ServerId, req.Name, req.Description, req.ClusterId)
if err != nil {
return nil, err
}
@@ -70,7 +70,42 @@ func (this *ServerService) UpdateServer(ctx context.Context, req *pb.UpdateServe
return nil, err
}
return &pb.UpdateServerResponse{}, nil
return &pb.UpdateServerBasicResponse{}, nil
}
// 修改服务配置
func (this *ServerService) UpdateServerConfig(ctx context.Context, req *pb.UpdateServerConfigRequest) (*pb.UpdateServerConfigResponse, error) {
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
}
if req.ServerId <= 0 {
return nil, errors.New("invalid serverId")
}
// 查找Server
server, err := models.SharedServerDAO.FindEnabledServer(req.ServerId)
if err != nil {
return nil, err
}
if server == nil {
return &pb.UpdateServerConfigResponse{}, nil
}
// 修改
err = models.SharedServerDAO.UpdateServerConfig(req.ServerId, req.Config)
if err != nil {
return nil, err
}
// 更新新的节点版本
err = models.SharedNodeDAO.UpdateAllNodesLatestVersionMatch(int64(server.ClusterId))
if err != nil {
return nil, err
}
return &pb.UpdateServerConfigResponse{}, nil
}
// 计算服务数量
@@ -106,6 +141,9 @@ func (this *ServerService) ListEnabledServers(ctx context.Context, req *pb.ListE
}
result = append(result, &pb.Server{
Id: int64(server.Id),
Type: server.Type,
Name: server.Name,
Description: server.Description,
Config: []byte(server.Config),
IncludeNodes: []byte(server.IncludeNodes),
ExcludeNodes: []byte(server.ExcludeNodes),
@@ -174,6 +212,9 @@ func (this *ServerService) FindEnabledServer(ctx context.Context, req *pb.FindEn
return &pb.FindEnabledServerResponse{Server: &pb.Server{
Id: int64(server.Id),
Type: server.Type,
Name: server.Name,
Description: server.Description,
Config: []byte(server.Config),
IncludeNodes: []byte(server.IncludeNodes),
ExcludeNodes: []byte(server.ExcludeNodes),