[API节点]支持HTTP API

This commit is contained in:
刘祥超
2021-01-01 20:48:30 +08:00
parent 6d9defcc9b
commit 68a039529d
7 changed files with 564 additions and 136 deletions

View File

@@ -39,6 +39,9 @@ type APINode struct {
Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"`
HttpJSON []byte `protobuf:"bytes,8,opt,name=httpJSON,proto3" json:"httpJSON,omitempty"`
HttpsJSON []byte `protobuf:"bytes,9,opt,name=httpsJSON,proto3" json:"httpsJSON,omitempty"`
RestIsOn bool `protobuf:"varint,13,opt,name=RestIsOn,proto3" json:"RestIsOn,omitempty"`
RestHTTPJSON []byte `protobuf:"bytes,14,opt,name=restHTTPJSON,proto3" json:"restHTTPJSON,omitempty"`
RestHTTPSJSON []byte `protobuf:"bytes,15,opt,name=restHTTPSJSON,proto3" json:"restHTTPSJSON,omitempty"`
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"`
@@ -139,6 +142,27 @@ func (x *APINode) GetHttpsJSON() []byte {
return nil
}
func (x *APINode) GetRestIsOn() bool {
if x != nil {
return x.RestIsOn
}
return false
}
func (x *APINode) GetRestHTTPJSON() []byte {
if x != nil {
return x.RestHTTPJSON
}
return nil
}
func (x *APINode) GetRestHTTPSJSON() []byte {
if x != nil {
return x.RestHTTPSJSON
}
return nil
}
func (x *APINode) GetAccessAddrsJSON() []byte {
if x != nil {
return x.AccessAddrsJSON
@@ -164,7 +188,7 @@ 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, 0xe3, 0x02, 0x0a, 0x07, 0x41,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xc9, 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,
@@ -180,14 +204,21 @@ var file_model_api_node_proto_rawDesc = []byte{
0x74, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x68, 0x74,
0x74, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73, 0x4a,
0x53, 0x4f, 0x4e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73,
0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64,
0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61,
0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20,
0x0a, 0x0b, 0x61, 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,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x74, 0x49, 0x73, 0x4f, 0x6e,
0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x52, 0x65, 0x73, 0x74, 0x49, 0x73, 0x4f, 0x6e,
0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x4a, 0x53, 0x4f, 0x4e,
0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50,
0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50,
0x53, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x72, 0x65, 0x73,
0x74, 0x48, 0x54, 0x54, 0x50, 0x53, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0a, 0x20,
0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73,
0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20, 0x0a, 0x0b, 0x61, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (