Create scaffolding of ddl-simulator
Implement global server as control plane Implement device to get their info from global server and connect each others
This commit is contained in:
@@ -0,0 +1,272 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.2
|
||||
// protoc v3.21.12
|
||||
// source: proto/global.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
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)
|
||||
)
|
||||
|
||||
type InitRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *InitRequest) Reset() {
|
||||
*x = InitRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_global_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *InitRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InitRequest) ProtoMessage() {}
|
||||
|
||||
func (x *InitRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_global_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 InitRequest.ProtoReflect.Descriptor instead.
|
||||
func (*InitRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_global_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *InitRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type InitResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
|
||||
Capacity *float32 `protobuf:"fixed32,2,opt,name=capacity,proto3,oneof" json:"capacity,omitempty"`
|
||||
Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"`
|
||||
Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
|
||||
ParentId *string `protobuf:"bytes,5,opt,name=parent_id,json=parentId,proto3,oneof" json:"parent_id,omitempty"`
|
||||
Pip *string `protobuf:"bytes,6,opt,name=pip,proto3,oneof" json:"pip,omitempty"`
|
||||
Pport *int32 `protobuf:"varint,7,opt,name=pport,proto3,oneof" json:"pport,omitempty"`
|
||||
}
|
||||
|
||||
func (x *InitResponse) Reset() {
|
||||
*x = InitResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_global_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *InitResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InitResponse) ProtoMessage() {}
|
||||
|
||||
func (x *InitResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_global_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 InitResponse.ProtoReflect.Descriptor instead.
|
||||
func (*InitResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_global_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *InitResponse) GetRole() string {
|
||||
if x != nil {
|
||||
return x.Role
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *InitResponse) GetCapacity() float32 {
|
||||
if x != nil && x.Capacity != nil {
|
||||
return *x.Capacity
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *InitResponse) GetIp() string {
|
||||
if x != nil {
|
||||
return x.Ip
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *InitResponse) GetPort() int32 {
|
||||
if x != nil {
|
||||
return x.Port
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *InitResponse) GetParentId() string {
|
||||
if x != nil && x.ParentId != nil {
|
||||
return *x.ParentId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *InitResponse) GetPip() string {
|
||||
if x != nil && x.Pip != nil {
|
||||
return *x.Pip
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *InitResponse) GetPport() int32 {
|
||||
if x != nil && x.Pport != nil {
|
||||
return *x.Pport
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_proto_global_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_proto_global_proto_rawDesc = []byte{
|
||||
0x0a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1d, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x02, 0x69, 0x64, 0x22, 0xe8, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61,
|
||||
0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x08, 0x63, 0x61,
|
||||
0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x20, 0x0a,
|
||||
0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
|
||||
0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12,
|
||||
0x15, 0x0a, 0x03, 0x70, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x03,
|
||||
0x70, 0x69, 0x70, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x18,
|
||||
0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x05, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x88, 0x01,
|
||||
0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x42, 0x0c,
|
||||
0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x42, 0x06, 0x0a, 0x04,
|
||||
0x5f, 0x70, 0x69, 0x70, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x32, 0x36,
|
||||
0x0a, 0x0d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
|
||||
0x25, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x0c, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x2e, 0x70, 0x65,
|
||||
0x6e, 0x67, 0x7a, 0x68, 0x61, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x64, 0x64, 0x70, 0x2d, 0x73,
|
||||
0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_proto_global_proto_rawDescOnce sync.Once
|
||||
file_proto_global_proto_rawDescData = file_proto_global_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_proto_global_proto_rawDescGZIP() []byte {
|
||||
file_proto_global_proto_rawDescOnce.Do(func() {
|
||||
file_proto_global_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_global_proto_rawDescData)
|
||||
})
|
||||
return file_proto_global_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_proto_global_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_proto_global_proto_goTypes = []any{
|
||||
(*InitRequest)(nil), // 0: InitRequest
|
||||
(*InitResponse)(nil), // 1: InitResponse
|
||||
}
|
||||
var file_proto_global_proto_depIdxs = []int32{
|
||||
0, // 0: globalService.Init:input_type -> InitRequest
|
||||
1, // 1: globalService.Init:output_type -> InitResponse
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_global_proto_init() }
|
||||
func file_proto_global_proto_init() {
|
||||
if File_proto_global_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_proto_global_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*InitRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_global_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*InitResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_proto_global_proto_msgTypes[1].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_global_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_proto_global_proto_goTypes,
|
||||
DependencyIndexes: file_proto_global_proto_depIdxs,
|
||||
MessageInfos: file_proto_global_proto_msgTypes,
|
||||
}.Build()
|
||||
File_proto_global_proto = out.File
|
||||
file_proto_global_proto_rawDesc = nil
|
||||
file_proto_global_proto_goTypes = nil
|
||||
file_proto_global_proto_depIdxs = nil
|
||||
}
|
||||
Reference in New Issue
Block a user