API节点增加主节点概念

This commit is contained in:
GoEdgeLab
2022-04-24 15:25:08 +08:00
parent 9142010f51
commit 97a622f5f2
4 changed files with 141 additions and 119 deletions

View File

@@ -45,6 +45,7 @@ type APINode struct {
AccessAddrsJSON []byte `protobuf:"bytes,10,opt,name=accessAddrsJSON,proto3" json:"accessAddrsJSON,omitempty"`
AccessAddrs []string `protobuf:"bytes,11,rep,name=accessAddrs,proto3" json:"accessAddrs,omitempty"`
StatusJSON []byte `protobuf:"bytes,12,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"`
IsPrimary bool `protobuf:"varint,16,opt,name=isPrimary,proto3" json:"isPrimary,omitempty"`
Debug bool `protobuf:"varint,30,opt,name=debug,proto3" json:"debug,omitempty"`
}
@@ -185,6 +186,13 @@ func (x *APINode) GetStatusJSON() []byte {
return nil
}
func (x *APINode) GetIsPrimary() bool {
if x != nil {
return x.IsPrimary
}
return false
}
func (x *APINode) GetDebug() bool {
if x != nil {
return x.Debug
@@ -197,7 +205,7 @@ var File_models_model_api_node_proto protoreflect.FileDescriptor
var file_models_model_api_node_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 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, 0xdf, 0x03, 0x0a, 0x07, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a,
0x62, 0x22, 0xfd, 0x03, 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, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
@@ -225,10 +233,12 @@ var file_models_model_api_node_proto_rawDesc = []byte{
0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x1e, 0x0a,
0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x14, 0x0a,
0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65,
0x62, 0x75, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a,
0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08,
0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x64,
0x65, 0x62, 0x75, 0x67, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75,
0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (