Skip to content

Commit

Permalink
feat:add discover stream grpc method for config (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored Nov 24, 2023
1 parent e0750ad commit d38b194
Show file tree
Hide file tree
Showing 4 changed files with 438 additions and 138 deletions.
38 changes: 33 additions & 5 deletions api/v1/config_manage/config_file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ option go_package = "github.com/polarismesh/specification/source/go/api/v1/confi
option java_package = "com.tencent.polaris.specification.api.v1.config.manage";
option java_outer_classname = "ConfigFileProto";


message ConfigFileGroup {
google.protobuf.UInt64Value id = 1;
google.protobuf.StringValue name = 2;
Expand Down Expand Up @@ -64,7 +63,6 @@ message ConfigFileTag {
google.protobuf.StringValue value = 2;
}


message ConfigFileRelease {
google.protobuf.UInt64Value id = 1;
google.protobuf.StringValue name = 2;
Expand All @@ -84,7 +82,7 @@ message ConfigFileRelease {
google.protobuf.BoolValue active = 15;
google.protobuf.StringValue format = 16;
google.protobuf.StringValue release_description = 17;
google.protobuf.UInt32Value type = 18;
google.protobuf.StringValue type = 18;
// 配置灰度发布时需要匹配的客户端标签信息
repeated ClientLabel beta_labels = 19;
}
Expand Down Expand Up @@ -161,13 +159,43 @@ message ConfigFilePublishInfo {
google.protobuf.StringValue content = 5;
google.protobuf.StringValue comment = 6;
google.protobuf.StringValue format = 7;
google.protobuf.StringValue release_description = 8 [ json_name = "release_description" ];
google.protobuf.StringValue release_description = 8
[ json_name = "release_description" ];
google.protobuf.StringValue create_by = 11 [ json_name = "create_by" ];
google.protobuf.StringValue modify_by = 13 [ json_name = "modify_by" ];
repeated ConfigFileTag tags = 14;
}

message ConfigFileGroupRequest {
google.protobuf.StringValue revision = 1;
ConfigFileGroup config_file_group = 2;
ConfigFileGroup config_file_group = 2 [ json_name = "config_file_group" ];
// 配置标签
map<string, string> client_labels = 12 [ json_name = "client_labels" ];
}

enum ConfigDiscoverType {
UNKNOWN = 0;
CONFIG_FILE = 1;
CONFIG_FILE_LIST = 2;
CONFIG_GROUPS = 3;
}

message ConfigDiscoverRequest {
ConfigDiscoverType type = 1;
string namespace = 2;
string group = 3;
string revision = 4;
}

message ConfigDiscoverResponse {
uint32 code = 1;
string info = 2;
string revision = 3;

ConfigDiscoverType type = 4;

ClientConfigFileInfo config_file = 5 [ json_name = "config_file" ];

repeated ClientConfigFileInfo config_file_names = 6 [ json_name = "config_file_names" ];
repeated ConfigFileGroup config_file_groups = 7 [ json_name = "config_file_groups" ];
}
1 change: 1 addition & 0 deletions api/v1/config_manage/grpc_config_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ service PolarisConfigGRPC {
// 拉取指定配置分组下的配置文件列表
rpc GetConfigFileMetadataList(ConfigFileGroupRequest) returns (ConfigClientListResponse) {}

rpc Discover(stream ConfigDiscoverRequest) returns (stream ConfigDiscoverResponse) {}
}
Loading

0 comments on commit d38b194

Please sign in to comment.