mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-05 22:30:25 +08:00
提供批量更新服务配置API(阶段性提交)
This commit is contained in:
@@ -10500,6 +10500,18 @@
|
|||||||
"user"
|
"user"
|
||||||
],
|
],
|
||||||
"isDeprecated": false
|
"isDeprecated": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "copyServerConfig",
|
||||||
|
"requestMessageName": "CopyServerConfigRequest",
|
||||||
|
"responseMessageName": "RPCSuccess",
|
||||||
|
"code": "rpc copyServerConfig(CopyServerConfigRequest) returns (RPCSuccess);",
|
||||||
|
"doc": "在服务之间复制配置",
|
||||||
|
"roles": [
|
||||||
|
"admin",
|
||||||
|
"user"
|
||||||
|
],
|
||||||
|
"isDeprecated": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"filename": "service_server.proto",
|
"filename": "service_server.proto",
|
||||||
@@ -11606,6 +11618,24 @@
|
|||||||
"filename": "service_traffic_package_price.proto",
|
"filename": "service_traffic_package_price.proto",
|
||||||
"doc": "流量包价格服务"
|
"doc": "流量包价格服务"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "UpdatingServerListService",
|
||||||
|
"methods": [
|
||||||
|
{
|
||||||
|
"name": "findUpdatingServerLists",
|
||||||
|
"requestMessageName": "FindUpdatingServerListsRequest",
|
||||||
|
"responseMessageName": "FindUpdatingServerListsResponse",
|
||||||
|
"code": "rpc findUpdatingServerLists(FindUpdatingServerListsRequest) returns (FindUpdatingServerListsResponse);",
|
||||||
|
"doc": "查找要更新的服务配置",
|
||||||
|
"roles": [
|
||||||
|
"node"
|
||||||
|
],
|
||||||
|
"isDeprecated": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"filename": "service_updating_server_list.proto",
|
||||||
|
"doc": "待更新服务列表服务"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "UserService",
|
"name": "UserService",
|
||||||
"methods": [
|
"methods": [
|
||||||
@@ -13602,6 +13632,11 @@
|
|||||||
"code": "message ComposeUserGlobalBoardResponse {\n\tint64 totalUsers = 1;\n\tint64 countTodayUsers = 2;\n\tint64 countWeeklyUsers = 3;\n\tint64 countUserNodes = 4;\n\tint64 countOfflineUserNodes = 5;\n\tint64 countVerifyingUsers = 6;\n\n\trepeated DailyStat dailyStats = 30;\n\trepeated NodeValue cpuNodeValues = 31;\n\trepeated NodeValue memoryNodeValues = 32;\n\trepeated NodeValue loadNodeValues = 33;\n\trepeated TrafficStat topTrafficStats = 34;\n\n\n\tmessage DailyStat {\n\t\tstring day = 1;\n\t\tint64 count = 2;\n\t}\n\n\n\tmessage TrafficStat {\n\t\tint64 userId = 1;\n\t\tstring userName = 2;\n\t\tint64 countRequests = 3;\n\t\tint64 bytes = 4;\n\t}\n}",
|
"code": "message ComposeUserGlobalBoardResponse {\n\tint64 totalUsers = 1;\n\tint64 countTodayUsers = 2;\n\tint64 countWeeklyUsers = 3;\n\tint64 countUserNodes = 4;\n\tint64 countOfflineUserNodes = 5;\n\tint64 countVerifyingUsers = 6;\n\n\trepeated DailyStat dailyStats = 30;\n\trepeated NodeValue cpuNodeValues = 31;\n\trepeated NodeValue memoryNodeValues = 32;\n\trepeated NodeValue loadNodeValues = 33;\n\trepeated TrafficStat topTrafficStats = 34;\n\n\n\tmessage DailyStat {\n\t\tstring day = 1;\n\t\tint64 count = 2;\n\t}\n\n\n\tmessage TrafficStat {\n\t\tint64 userId = 1;\n\t\tstring userName = 2;\n\t\tint64 countRequests = 3;\n\t\tint64 bytes = 4;\n\t}\n}",
|
||||||
"doc": ""
|
"doc": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "CopyServerConfigRequest",
|
||||||
|
"code": "message CopyServerConfigRequest {\n\tint64 serverId = 1; // 被复制服务ID\n\tstring configCode = 2; // 要拷贝的配置代号\n\tstring targetType = 3; // 目标类型:servers, groups, cluster(当前集群下所有服务,只有管理员才有权限)、user(当前用户下所有服务)\n\trepeated int64 targetServerIds = 4; // 目标服务ID列表\n\trepeated int64 targetServerGroupIds = 5; // 目标服务分组ID列表\n\tint64 targetClusterId = 6; // 目标集群ID\n\tint64 targetUserId = 7; // 目标用户ID\n}",
|
||||||
|
"doc": "在服务之间复制配置"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "CountADPackageInstancesRequest",
|
"name": "CountADPackageInstancesRequest",
|
||||||
"code": "message CountADPackageInstancesRequest {\n\tint64 adNetworkId = 1; // 可选,线路\n\tint64 adPackageId = 2; // 可选,如果不填则表示获取所有实例数量\n\tint64 userId = 3; // 可选,用户ID\n\tstring ip = 4; // 可选,高防IP\n}",
|
"code": "message CountADPackageInstancesRequest {\n\tint64 adNetworkId = 1; // 可选,线路\n\tint64 adPackageId = 2; // 可选,如果不填则表示获取所有实例数量\n\tint64 userId = 3; // 可选,用户ID\n\tstring ip = 4; // 可选,高防IP\n}",
|
||||||
@@ -14034,7 +14069,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "CountLogRequest",
|
"name": "CountLogRequest",
|
||||||
"code": "message CountLogRequest {\n\tstring dayFrom = 1;\n\tstring dayTo = 2;\n\tstring keyword = 3;\n\tstring userType = 4; // admin|user\n}",
|
"code": "message CountLogRequest {\n\tstring dayFrom = 1; // 可选项,开始日期\n\tstring dayTo = 2; // 可选项,结束日期\n\tstring keyword = 3; // 可选项,关键词\n\tstring userType = 4; // 可选项,用户类型:admin|user;用户端固定为user\n\tstring level = 5; // 可选项,错误级别:info, warn, error\n}",
|
||||||
"doc": "计算日志数量"
|
"doc": "计算日志数量"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -18982,6 +19017,16 @@
|
|||||||
"code": "message FindTrafficPackageResponse {\n\tTrafficPackage trafficPackage = 1;\n}",
|
"code": "message FindTrafficPackageResponse {\n\tTrafficPackage trafficPackage = 1;\n}",
|
||||||
"doc": ""
|
"doc": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "FindUpdatingServerListsRequest",
|
||||||
|
"code": "message FindUpdatingServerListsRequest {\n\tint64 lastId = 1; // 上一次读取的列表ID\n}",
|
||||||
|
"doc": "查找要更新的服务配置"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FindUpdatingServerListsResponse",
|
||||||
|
"code": "message FindUpdatingServerListsResponse {\n\tbytes serversJSON = 1; // 服务配置列表\n\tint64 maxId = 2; // 最大的一个列表ID\n}",
|
||||||
|
"doc": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "FindUserADInstanceRequest",
|
"name": "FindUserADInstanceRequest",
|
||||||
"code": "message FindUserADInstanceRequest {\n\tint64 userADInstanceId = 1;\n}",
|
"code": "message FindUserADInstanceRequest {\n\tint64 userADInstanceId = 1;\n}",
|
||||||
@@ -19664,7 +19709,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ListLogsRequest",
|
"name": "ListLogsRequest",
|
||||||
"code": "message ListLogsRequest {\n\tint64 offset = 1;\n\tint64 size = 2;\n\tstring dayFrom = 3;\n\tstring dayTo = 4;\n\tstring keyword = 5;\n\tstring userType = 6;\n}",
|
"code": "message ListLogsRequest {\n\tint64 offset = 1; // 读取位置,从0开始\n\tint64 size = 2; // 读取数量\n\tstring dayFrom = 3; // 可选项,开始日期\n\tstring dayTo = 4; // 可选项,结束日期\n\tstring keyword = 5; // 可选项,关键词\n\tstring userType = 6; // 可选项,用户类型:admin|user;用户端固定为user\n\tstring level = 7; // 可选项,错误级别:info, warn, error\n}",
|
||||||
"doc": "列出单页日志"
|
"doc": "列出单页日志"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ type NodeConfig struct {
|
|||||||
RegionId int64 `yaml:"regionId" json:"regionId"`
|
RegionId int64 `yaml:"regionId" json:"regionId"`
|
||||||
OCSPVersion int64 `yaml:"ocspVersion" json:"ocspVersion"`
|
OCSPVersion int64 `yaml:"ocspVersion" json:"ocspVersion"`
|
||||||
DataMap *shared.DataMap `yaml:"dataMap" json:"dataMap"`
|
DataMap *shared.DataMap `yaml:"dataMap" json:"dataMap"`
|
||||||
|
UpdatingServerListId int64 `yaml:"updatingServerListId" json:"updatingServerListId"`
|
||||||
|
|
||||||
// 性能
|
// 性能
|
||||||
MaxCPU int32 `yaml:"maxCPU" json:"maxCPU"`
|
MaxCPU int32 `yaml:"maxCPU" json:"maxCPU"`
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
319
pkg/rpc/pb/service_updating_server_list.pb.go
Normal file
319
pkg/rpc/pb/service_updating_server_list.pb.go
Normal file
@@ -0,0 +1,319 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.25.0
|
||||||
|
// protoc v3.19.4
|
||||||
|
// source: service_updating_server_list.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 FindUpdatingServerListsRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
LastId int64 `protobuf:"varint,1,opt,name=lastId,proto3" json:"lastId,omitempty"` // 上一次读取的列表ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsRequest) Reset() {
|
||||||
|
*x = FindUpdatingServerListsRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_service_updating_server_list_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*FindUpdatingServerListsRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_service_updating_server_list_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 FindUpdatingServerListsRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*FindUpdatingServerListsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_service_updating_server_list_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsRequest) GetLastId() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.LastId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type FindUpdatingServerListsResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
ServersJSON []byte `protobuf:"bytes,1,opt,name=serversJSON,proto3" json:"serversJSON,omitempty"` // 服务配置列表
|
||||||
|
MaxId int64 `protobuf:"varint,2,opt,name=maxId,proto3" json:"maxId,omitempty"` // 最大的一个列表ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsResponse) Reset() {
|
||||||
|
*x = FindUpdatingServerListsResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_service_updating_server_list_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*FindUpdatingServerListsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_service_updating_server_list_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 FindUpdatingServerListsResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*FindUpdatingServerListsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_service_updating_server_list_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsResponse) GetServersJSON() []byte {
|
||||||
|
if x != nil {
|
||||||
|
return x.ServersJSON
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *FindUpdatingServerListsResponse) GetMaxId() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.MaxId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_service_updating_server_list_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_service_updating_server_list_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x22, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x69,
|
||||||
|
0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x38, 0x0a, 0x1e, 0x46, 0x69, 0x6e, 0x64,
|
||||||
|
0x55, 0x70, 0x64, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4c, 0x69,
|
||||||
|
0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61,
|
||||||
|
0x73, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x61, 0x73, 0x74,
|
||||||
|
0x49, 0x64, 0x22, 0x59, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x69,
|
||||||
|
0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73,
|
||||||
|
0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76,
|
||||||
|
0x65, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x78, 0x49, 0x64,
|
||||||
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x61, 0x78, 0x49, 0x64, 0x32, 0x7f, 0x0a,
|
||||||
|
0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4c,
|
||||||
|
0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x17, 0x66, 0x69,
|
||||||
|
0x6e, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||||
|
0x4c, 0x69, 0x73, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55,
|
||||||
|
0x70, 0x64, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4c, 0x69, 0x73,
|
||||||
|
0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x46,
|
||||||
|
0x69, 0x6e, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65,
|
||||||
|
0x72, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06,
|
||||||
|
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_service_updating_server_list_proto_rawDescOnce sync.Once
|
||||||
|
file_service_updating_server_list_proto_rawDescData = file_service_updating_server_list_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_service_updating_server_list_proto_rawDescGZIP() []byte {
|
||||||
|
file_service_updating_server_list_proto_rawDescOnce.Do(func() {
|
||||||
|
file_service_updating_server_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_updating_server_list_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_service_updating_server_list_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_service_updating_server_list_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_service_updating_server_list_proto_goTypes = []interface{}{
|
||||||
|
(*FindUpdatingServerListsRequest)(nil), // 0: pb.FindUpdatingServerListsRequest
|
||||||
|
(*FindUpdatingServerListsResponse)(nil), // 1: pb.FindUpdatingServerListsResponse
|
||||||
|
}
|
||||||
|
var file_service_updating_server_list_proto_depIdxs = []int32{
|
||||||
|
0, // 0: pb.UpdatingServerListService.findUpdatingServerLists:input_type -> pb.FindUpdatingServerListsRequest
|
||||||
|
1, // 1: pb.UpdatingServerListService.findUpdatingServerLists:output_type -> pb.FindUpdatingServerListsResponse
|
||||||
|
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_service_updating_server_list_proto_init() }
|
||||||
|
func file_service_updating_server_list_proto_init() {
|
||||||
|
if File_service_updating_server_list_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_service_updating_server_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*FindUpdatingServerListsRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_service_updating_server_list_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*FindUpdatingServerListsResponse); 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_updating_server_list_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_service_updating_server_list_proto_goTypes,
|
||||||
|
DependencyIndexes: file_service_updating_server_list_proto_depIdxs,
|
||||||
|
MessageInfos: file_service_updating_server_list_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_service_updating_server_list_proto = out.File
|
||||||
|
file_service_updating_server_list_proto_rawDesc = nil
|
||||||
|
file_service_updating_server_list_proto_goTypes = nil
|
||||||
|
file_service_updating_server_list_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
|
||||||
|
|
||||||
|
// UpdatingServerListServiceClient is the client API for UpdatingServerListService service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||||
|
type UpdatingServerListServiceClient interface {
|
||||||
|
// 查找要更新的服务配置
|
||||||
|
FindUpdatingServerLists(ctx context.Context, in *FindUpdatingServerListsRequest, opts ...grpc.CallOption) (*FindUpdatingServerListsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type updatingServerListServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUpdatingServerListServiceClient(cc grpc.ClientConnInterface) UpdatingServerListServiceClient {
|
||||||
|
return &updatingServerListServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *updatingServerListServiceClient) FindUpdatingServerLists(ctx context.Context, in *FindUpdatingServerListsRequest, opts ...grpc.CallOption) (*FindUpdatingServerListsResponse, error) {
|
||||||
|
out := new(FindUpdatingServerListsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/pb.UpdatingServerListService/findUpdatingServerLists", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdatingServerListServiceServer is the server API for UpdatingServerListService service.
|
||||||
|
type UpdatingServerListServiceServer interface {
|
||||||
|
// 查找要更新的服务配置
|
||||||
|
FindUpdatingServerLists(context.Context, *FindUpdatingServerListsRequest) (*FindUpdatingServerListsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedUpdatingServerListServiceServer can be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedUpdatingServerListServiceServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UnimplementedUpdatingServerListServiceServer) FindUpdatingServerLists(context.Context, *FindUpdatingServerListsRequest) (*FindUpdatingServerListsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method FindUpdatingServerLists not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterUpdatingServerListServiceServer(s *grpc.Server, srv UpdatingServerListServiceServer) {
|
||||||
|
s.RegisterService(&_UpdatingServerListService_serviceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _UpdatingServerListService_FindUpdatingServerLists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(FindUpdatingServerListsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(UpdatingServerListServiceServer).FindUpdatingServerLists(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/pb.UpdatingServerListService/FindUpdatingServerLists",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(UpdatingServerListServiceServer).FindUpdatingServerLists(ctx, req.(*FindUpdatingServerListsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _UpdatingServerListService_serviceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "pb.UpdatingServerListService",
|
||||||
|
HandlerType: (*UpdatingServerListServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "findUpdatingServerLists",
|
||||||
|
Handler: _UpdatingServerListService_FindUpdatingServerLists_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "service_updating_server_list.proto",
|
||||||
|
}
|
||||||
@@ -172,6 +172,9 @@ service ServerService {
|
|||||||
|
|
||||||
// 修改服务名称
|
// 修改服务名称
|
||||||
rpc updateServerName(UpdateServerNameRequest) returns (RPCSuccess);
|
rpc updateServerName(UpdateServerNameRequest) returns (RPCSuccess);
|
||||||
|
|
||||||
|
// 在服务之间复制配置
|
||||||
|
rpc copyServerConfig(CopyServerConfigRequest) returns (RPCSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建服务
|
// 创建服务
|
||||||
@@ -671,3 +674,14 @@ message UpdateServerNameRequest {
|
|||||||
int64 serverId = 1; // 服务ID
|
int64 serverId = 1; // 服务ID
|
||||||
string name = 2; // 服务名称
|
string name = 2; // 服务名称
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 在服务之间复制配置
|
||||||
|
message CopyServerConfigRequest {
|
||||||
|
int64 serverId = 1; // 被复制服务ID
|
||||||
|
string configCode = 2; // 要拷贝的配置代号
|
||||||
|
string targetType = 3; // 目标类型:servers, groups, cluster(当前集群下所有服务,只有管理员才有权限)、user(当前用户下所有服务)
|
||||||
|
repeated int64 targetServerIds = 4; // 目标服务ID列表
|
||||||
|
repeated int64 targetServerGroupIds = 5; // 目标服务分组ID列表
|
||||||
|
int64 targetClusterId = 6; // 目标集群ID
|
||||||
|
int64 targetUserId = 7; // 目标用户ID
|
||||||
|
}
|
||||||
20
pkg/rpc/protos/service_updating_server_list.proto
Normal file
20
pkg/rpc/protos/service_updating_server_list.proto
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
option go_package = "./pb";
|
||||||
|
|
||||||
|
package pb;
|
||||||
|
|
||||||
|
// 待更新服务列表服务
|
||||||
|
service UpdatingServerListService {
|
||||||
|
// 查找要更新的服务配置
|
||||||
|
rpc findUpdatingServerLists(FindUpdatingServerListsRequest) returns (FindUpdatingServerListsResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查找要更新的服务配置
|
||||||
|
message FindUpdatingServerListsRequest {
|
||||||
|
int64 lastId = 1; // 上一次读取的列表ID
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindUpdatingServerListsResponse {
|
||||||
|
bytes serversJSON = 1; // 服务配置列表
|
||||||
|
int64 maxId = 2; // 最大的一个列表ID
|
||||||
|
}
|
||||||
33
pkg/serverconfigs/config_codes.go
Normal file
33
pkg/serverconfigs/config_codes.go
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// Copyright 2023 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||||
|
|
||||||
|
package serverconfigs
|
||||||
|
|
||||||
|
type ConfigCode = string
|
||||||
|
|
||||||
|
const (
|
||||||
|
ConfigCodeUAM ConfigCode = "uam"
|
||||||
|
ConfigCodeCC ConfigCode = "cc"
|
||||||
|
ConfigCodeRedirects ConfigCode = "redirects"
|
||||||
|
ConfigCodeLocations ConfigCode = "locations"
|
||||||
|
ConfigCodeRewrites ConfigCode = "rewrites"
|
||||||
|
ConfigCodeWAF ConfigCode = "waf"
|
||||||
|
ConfigCodeCache ConfigCode = "cache"
|
||||||
|
ConfigCodeAccess ConfigCode = "access"
|
||||||
|
ConfigCodeReferers ConfigCode = "referers"
|
||||||
|
ConfigCodeUserAgent ConfigCode = "userAgent"
|
||||||
|
ConfigCodeCharset ConfigCode = "charset"
|
||||||
|
ConfigCodeAccessLog ConfigCode = "accessLog"
|
||||||
|
ConfigCodeStat ConfigCode = "stat"
|
||||||
|
ConfigCodeCompression ConfigCode = "compression"
|
||||||
|
ConfigCodePages ConfigCode = "pages"
|
||||||
|
ConfigCodeHeaders ConfigCode = "headers"
|
||||||
|
ConfigCodeWebsocket ConfigCode = "websocket"
|
||||||
|
ConfigCodeWebp ConfigCode = "webp"
|
||||||
|
ConfigCodeWeb ConfigCode = "web"
|
||||||
|
ConfigCodeFastcgi ConfigCode = "fastcgi"
|
||||||
|
ConfigCodeRemoteAddr ConfigCode = "remoteAddr"
|
||||||
|
ConfigCodeRequestLimit ConfigCode = "requestLimit"
|
||||||
|
ConfigCodeTraffic ConfigCode = "traffic"
|
||||||
|
ConfigCodeRequestScripts ConfigCode = "requestScripts"
|
||||||
|
ConfigCodeCommon ConfigCode = "common"
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user