diff --git a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/released_kv.go b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/released_kv.go index f3cb971462..e74ee6fee5 100644 --- a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/released_kv.go +++ b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/released_kv.go @@ -33,12 +33,12 @@ func (c *client) GetReleasedKv(kt *kit.Kit, bizID uint32, releaseID uint32) (str kv, hit, err := c.getReleasedKvFromCache(kt, bizID, releaseID) if err != nil { - return "", nil + return "", err } if hit { c.mc.hitCounter.With(prm.Labels{"rsc": releasedKvRes, "biz": tools.Itoa(bizID)}).Inc() - return kv, err + return kv, nil } // do not find released kv in the cache, then try it get from db directly. diff --git a/bcs-services/bcs-bscp/cmd/feed-server/service/interceptor.go b/bcs-services/bcs-bscp/cmd/feed-server/service/interceptor.go index 389ad0c2fb..e77d3762c8 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/service/interceptor.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/service/interceptor.go @@ -29,9 +29,10 @@ import ( var ( // 兼容老的请求, 只部分方法使用中间件 allowMethod = map[string]struct{}{ - "/pbfs.Upstream/ListApps": {}, - "/pbfs.Upstream/PullKvMeta": {}, - "/pbfs.Upstream/GetKvValue": {}, + "/pbfs.Upstream/ListApps": {}, + "/pbfs.Upstream/PullKvMeta": {}, + "/pbfs.Upstream/GetKvValue": {}, + "/pbfs.Upstream/GetKvValues": {}, } ) diff --git a/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go b/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go index 6081b12058..2fd6211319 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go @@ -17,6 +17,7 @@ import ( "fmt" "path" "strings" + "sync" prm "github.com/prometheus/client_golang/prometheus" "google.golang.org/grpc/codes" @@ -469,6 +470,122 @@ func (s *Service) GetKvValue(ctx context.Context, req *pbfs.GetKvValueReq) (*pbf return kv, nil } +// GetKvValues gets kv values, get all kv values if keys are empty +func (s *Service) GetKvValues(ctx context.Context, req *pbfs.GetKvValuesReq) (*pbfs.GetKvValuesResp, error) { + kt := kit.FromGrpcContext(ctx) + if req.GetAppMeta() == nil || req.GetAppMeta().App == "" { + return nil, status.Error(codes.InvalidArgument, "app_meta is required") + } + + credential := getCredential(ctx) + if !credential.MatchApp(req.AppMeta.App) { + return nil, status.Errorf(codes.PermissionDenied, "not have app %s permission", req.AppMeta.App) + } + + allowedKeys := make([]string, 0) + notAllowed := make([]string, 0) + if len(req.Keys) > 0 { + for _, k := range req.Keys { + if !credential.MatchKv(req.AppMeta.App, k) { + notAllowed = append(notAllowed, k) + continue + } + allowedKeys = append(allowedKeys, k) + } + + if len(notAllowed) > 0 { + return nil, status.Error(codes.PermissionDenied, fmt.Sprintf("no permission get value for key in %v", + notAllowed)) + } + } + + appID, err := s.bll.AppCache().GetAppID(kt, req.BizId, req.GetAppMeta().App) + if err != nil { + return nil, status.Errorf(codes.Aborted, "get app id failed, %s", err.Error()) + } + + app, err := s.bll.AppCache().GetMeta(kt, req.BizId, appID) + if err != nil { + return nil, status.Errorf(codes.Aborted, "get app failed, %s", err.Error()) + } + + if app.ConfigType != table.KV { + return nil, status.Errorf(codes.Aborted, "app not %s type", table.KV) + } + + meta := &types.AppInstanceMeta{ + BizID: req.BizId, + App: req.GetAppMeta().App, + AppID: appID, + Uid: req.AppMeta.Uid, + Labels: req.AppMeta.Labels, + } + + metas, err := s.bll.Release().ListAppLatestReleaseKvMeta(kt, meta) + if err != nil { + return nil, err + } + + // if input keys are empty, use all the keys + if len(req.Keys) == 0 { + for _, kv := range metas.Kvs { + if credential.MatchKv(req.AppMeta.App, kv.Key) { + allowedKeys = append(allowedKeys, kv.Key) + } + } + if len(allowedKeys) == 0 { + return nil, status.Error(codes.PermissionDenied, "no permission get value for any key") + } + } + + kvs, hitError := s.getKvValues(kt, req.BizId, appID, metas.ReleaseId, allowedKeys) + if hitError != nil { + // appid等未找到, 刷新缓存, 客户端重试请求 + if isAppNotExistErr(hitError) { + s.bll.AppCache().RemoveCache(kt, req.BizId, req.GetAppMeta().App) + } + return nil, status.Errorf(codes.Aborted, hitError.Error()) + } + + return &pbfs.GetKvValuesResp{ + Kvs: kvs, + }, nil +} + +// getKvValues get kv values concurrently +func (s *Service) getKvValues(kt *kit.Kit, bizID, appID, releaseID uint32, allowedKeys []string) ([]*pbfs.KV, error) { + var hitError error + kvs := make([]*pbfs.KV, len(allowedKeys)) + pipe := make(chan struct{}, 10) + wg := sync.WaitGroup{} + + for idx, key := range allowedKeys { + wg.Add(1) + + pipe <- struct{}{} + go func(idx int, key string) { + defer func() { + wg.Done() + <-pipe + }() + + rkv, err := s.bll.RKvCache().GetKvValue(kt, bizID, appID, releaseID, key) + if err != nil { + hitError = fmt.Errorf("get kv value failed for key: %s, err:%v", key, err) + return + } + kvs[idx] = &pbfs.KV{ + Key: rkv.Key, + KvType: rkv.KvType, + Value: rkv.Value, + } + }(idx, key) + } + wg.Wait() + + return kvs, hitError +} + // isAppNotExistErr 检测app不存在错误, 有grpc,目前通过 msg 判断 // msg = rpc error: code = Code(4000005) desc = app %d not exist func isAppNotExistErr(err error) bool { diff --git a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go index abaabb692d..7576c0e290 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go @@ -222,12 +222,12 @@ type ConfigClient interface { CreateTemplateRevision(ctx context.Context, in *CreateTemplateRevisionReq, opts ...grpc.CallOption) (*CreateTemplateRevisionResp, error) ListTemplateRevisions(ctx context.Context, in *ListTemplateRevisionsReq, opts ...grpc.CallOption) (*ListTemplateRevisionsResp, error) // 暂时不对外开发(删除模版后,服务引用的latest版本会回退到上一个老版本) - //rpc DeleteTemplateRevision(DeleteTemplateRevisionReq) returns (DeleteTemplateRevisionResp) { - //option (google.api.http) = { - //delete : - //"/api/v1/config/biz/{biz_id}/template_spaces/{template_space_id}/templates/{template_id}/template_revisions/{template_revision_id}" - //}; - //} + // rpc DeleteTemplateRevision(DeleteTemplateRevisionReq) returns (DeleteTemplateRevisionResp) { + // option (google.api.http) = { + // delete : + // "/api/v1/config/biz/{biz_id}/template_spaces/{template_space_id}/templates/{template_id}/template_revisions/{template_revision_id}" + // }; + // } ListTemplateRevisionsByIDs(ctx context.Context, in *ListTemplateRevisionsByIDsReq, opts ...grpc.CallOption) (*ListTemplateRevisionsByIDsResp, error) ListTmplRevisionNamesByTmplIDs(ctx context.Context, in *ListTmplRevisionNamesByTmplIDsReq, opts ...grpc.CallOption) (*ListTmplRevisionNamesByTmplIDsResp, error) CreateTemplateSet(ctx context.Context, in *CreateTemplateSetReq, opts ...grpc.CallOption) (*CreateTemplateSetResp, error) @@ -1498,12 +1498,12 @@ type ConfigServer interface { CreateTemplateRevision(context.Context, *CreateTemplateRevisionReq) (*CreateTemplateRevisionResp, error) ListTemplateRevisions(context.Context, *ListTemplateRevisionsReq) (*ListTemplateRevisionsResp, error) // 暂时不对外开发(删除模版后,服务引用的latest版本会回退到上一个老版本) - //rpc DeleteTemplateRevision(DeleteTemplateRevisionReq) returns (DeleteTemplateRevisionResp) { - //option (google.api.http) = { - //delete : - //"/api/v1/config/biz/{biz_id}/template_spaces/{template_space_id}/templates/{template_id}/template_revisions/{template_revision_id}" - //}; - //} + // rpc DeleteTemplateRevision(DeleteTemplateRevisionReq) returns (DeleteTemplateRevisionResp) { + // option (google.api.http) = { + // delete : + // "/api/v1/config/biz/{biz_id}/template_spaces/{template_space_id}/templates/{template_id}/template_revisions/{template_revision_id}" + // }; + // } ListTemplateRevisionsByIDs(context.Context, *ListTemplateRevisionsByIDsReq) (*ListTemplateRevisionsByIDsResp, error) ListTmplRevisionNamesByTmplIDs(context.Context, *ListTmplRevisionNamesByTmplIDsReq) (*ListTmplRevisionNamesByTmplIDsResp, error) CreateTemplateSet(context.Context, *CreateTemplateSetReq) (*CreateTemplateSetResp, error) diff --git a/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.pb.go b/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.pb.go index 23ab23fe04..c390bf15e8 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.pb.go @@ -1451,6 +1451,179 @@ func (x *GetKvValueResp) GetValue() string { return "" } +type KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + KvType string `protobuf:"bytes,2,opt,name=kv_type,json=kvType,proto3" json:"kv_type,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KV) Reset() { + *x = KV{} + if protoimpl.UnsafeEnabled { + mi := &file_feed_server_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KV) ProtoMessage() {} + +func (x *KV) ProtoReflect() protoreflect.Message { + mi := &file_feed_server_proto_msgTypes[23] + 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 KV.ProtoReflect.Descriptor instead. +func (*KV) Descriptor() ([]byte, []int) { + return file_feed_server_proto_rawDescGZIP(), []int{23} +} + +func (x *KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KV) GetKvType() string { + if x != nil { + return x.KvType + } + return "" +} + +func (x *KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type GetKvValuesReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppMeta *AppMeta `protobuf:"bytes,2,opt,name=app_meta,json=appMeta,proto3" json:"app_meta,omitempty"` + Keys []string `protobuf:"bytes,3,rep,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *GetKvValuesReq) Reset() { + *x = GetKvValuesReq{} + if protoimpl.UnsafeEnabled { + mi := &file_feed_server_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetKvValuesReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKvValuesReq) ProtoMessage() {} + +func (x *GetKvValuesReq) ProtoReflect() protoreflect.Message { + mi := &file_feed_server_proto_msgTypes[24] + 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 GetKvValuesReq.ProtoReflect.Descriptor instead. +func (*GetKvValuesReq) Descriptor() ([]byte, []int) { + return file_feed_server_proto_rawDescGZIP(), []int{24} +} + +func (x *GetKvValuesReq) GetBizId() uint32 { + if x != nil { + return x.BizId + } + return 0 +} + +func (x *GetKvValuesReq) GetAppMeta() *AppMeta { + if x != nil { + return x.AppMeta + } + return nil +} + +func (x *GetKvValuesReq) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +type GetKvValuesResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kvs []*KV `protobuf:"bytes,1,rep,name=kvs,proto3" json:"kvs,omitempty"` +} + +func (x *GetKvValuesResp) Reset() { + *x = GetKvValuesResp{} + if protoimpl.UnsafeEnabled { + mi := &file_feed_server_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetKvValuesResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKvValuesResp) ProtoMessage() {} + +func (x *GetKvValuesResp) ProtoReflect() protoreflect.Message { + mi := &file_feed_server_proto_msgTypes[25] + 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 GetKvValuesResp.ProtoReflect.Descriptor instead. +func (*GetKvValuesResp) Descriptor() ([]byte, []int) { + return file_feed_server_proto_rawDescGZIP(), []int{25} +} + +func (x *GetKvValuesResp) GetKvs() []*KV { + if x != nil { + return x.Kvs + } + return nil +} + var File_feed_server_proto protoreflect.FileDescriptor var file_feed_server_proto_rawDesc = []byte{ @@ -1630,44 +1803,62 @@ var file_feed_server_proto_rawDesc = []byte{ 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6b, 0x76, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x32, 0xf5, 0x03, 0x0a, 0x08, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x12, 0x3a, 0x0a, 0x09, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x12, 0x16, - 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x48, 0x61, - 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, - 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x66, - 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x1a, - 0x13, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, - 0x13, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x64, 0x65, 0x57, 0x61, 0x74, 0x63, 0x68, - 0x4d, 0x65, 0x74, 0x61, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x46, 0x65, 0x65, 0x64, - 0x57, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, - 0x12, 0x48, 0x0a, 0x0f, 0x50, 0x75, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x4d, - 0x65, 0x74, 0x61, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x41, - 0x70, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, - 0x70, 0x62, 0x66, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x46, 0x69, 0x6c, 0x65, - 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0e, 0x47, 0x65, - 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x66, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, - 0x52, 0x4c, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x47, 0x65, 0x74, - 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x4b, 0x76, 0x4d, 0x65, 0x74, 0x61, 0x12, - 0x13, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4b, 0x76, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, - 0x4b, 0x76, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0a, - 0x47, 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x66, - 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x1a, - 0x14, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x70, 0x73, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x57, 0x5a, 0x55, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x65, 0x6e, 0x63, 0x65, - 0x6e, 0x74, 0x42, 0x6c, 0x75, 0x65, 0x4b, 0x69, 0x6e, 0x67, 0x2f, 0x62, 0x6b, 0x2d, 0x62, 0x63, - 0x73, 0x2f, 0x62, 0x63, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x62, - 0x63, 0x73, 0x2d, 0x62, 0x73, 0x63, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x66, 0x65, 0x65, 0x64, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x3b, 0x70, 0x62, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x07, + 0x6b, 0x76, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6b, + 0x76, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, + 0x69, 0x7a, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x41, 0x70, + 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x12, + 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, + 0x79, 0x73, 0x22, 0x2d, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x76, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x03, 0x6b, 0x76, + 0x73, 0x32, 0xb3, 0x04, 0x0a, 0x08, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x3a, + 0x0a, 0x09, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, + 0x66, 0x73, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x73, + 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x09, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x1a, 0x13, 0x2e, 0x70, + 0x62, 0x66, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x13, 0x2e, 0x70, + 0x62, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x64, 0x65, 0x57, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x74, + 0x61, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x46, 0x65, 0x65, 0x64, 0x57, 0x61, 0x74, + 0x63, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x48, 0x0a, + 0x0f, 0x50, 0x75, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, + 0x12, 0x18, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x46, + 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x66, + 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x41, 0x70, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x6f, + 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x66, 0x73, + 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x52, + 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, + 0x0a, 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x4b, 0x76, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x13, 0x2e, 0x70, + 0x62, 0x66, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4b, 0x76, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, + 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4b, 0x76, 0x4d, + 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x47, + 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, + 0x62, 0x66, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x76, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x66, 0x73, + 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x76, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x33, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x12, 0x11, + 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, + 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x66, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x57, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x75, + 0x65, 0x4b, 0x69, 0x6e, 0x67, 0x2f, 0x62, 0x6b, 0x2d, 0x62, 0x63, 0x73, 0x2f, 0x62, 0x63, 0x73, + 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x62, 0x63, 0x73, 0x2d, 0x62, 0x73, + 0x63, 0x70, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, + 0x66, 0x65, 0x65, 0x64, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3b, 0x70, 0x62, 0x66, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1682,7 +1873,7 @@ func file_feed_server_proto_rawDescGZIP() []byte { return file_feed_server_proto_rawDescData } -var file_feed_server_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_feed_server_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_feed_server_proto_goTypes = []interface{}{ (*SidecarSpec)(nil), // 0: pbfs.SidecarSpec (*HandshakeMessage)(nil), // 1: pbfs.HandshakeMessage @@ -1707,64 +1898,71 @@ var file_feed_server_proto_goTypes = []interface{}{ (*KvMeta)(nil), // 20: pbfs.KvMeta (*GetKvValueReq)(nil), // 21: pbfs.GetKvValueReq (*GetKvValueResp)(nil), // 22: pbfs.GetKvValueResp - nil, // 23: pbfs.AppMeta.LabelsEntry - (*base.Versioning)(nil), // 24: pbbase.Versioning - (*commit.CommitSpec)(nil), // 25: pbcommit.CommitSpec - (*config_item.ConfigItemSpec)(nil), // 26: pbci.ConfigItemSpec - (*config_item.ConfigItemAttachment)(nil), // 27: pbci.ConfigItemAttachment - (*hook.HookSpec)(nil), // 28: pbhook.HookSpec - (*base.Revision)(nil), // 29: pbbase.Revision - (*kv.KvAttachment)(nil), // 30: pbkv.KvAttachment + (*KV)(nil), // 23: pbfs.KV + (*GetKvValuesReq)(nil), // 24: pbfs.GetKvValuesReq + (*GetKvValuesResp)(nil), // 25: pbfs.GetKvValuesResp + nil, // 26: pbfs.AppMeta.LabelsEntry + (*base.Versioning)(nil), // 27: pbbase.Versioning + (*commit.CommitSpec)(nil), // 28: pbcommit.CommitSpec + (*config_item.ConfigItemSpec)(nil), // 29: pbci.ConfigItemSpec + (*config_item.ConfigItemAttachment)(nil), // 30: pbci.ConfigItemAttachment + (*hook.HookSpec)(nil), // 31: pbhook.HookSpec + (*base.Revision)(nil), // 32: pbbase.Revision + (*kv.KvAttachment)(nil), // 33: pbkv.KvAttachment } var file_feed_server_proto_depIdxs = []int32{ - 24, // 0: pbfs.SidecarSpec.version:type_name -> pbbase.Versioning - 24, // 1: pbfs.HandshakeMessage.api_version:type_name -> pbbase.Versioning + 27, // 0: pbfs.SidecarSpec.version:type_name -> pbbase.Versioning + 27, // 1: pbfs.HandshakeMessage.api_version:type_name -> pbbase.Versioning 0, // 2: pbfs.HandshakeMessage.spec:type_name -> pbfs.SidecarSpec - 24, // 3: pbfs.HandshakeResp.api_version:type_name -> pbbase.Versioning - 24, // 4: pbfs.MessagingMeta.api_version:type_name -> pbbase.Versioning - 24, // 5: pbfs.SideWatchMeta.api_version:type_name -> pbbase.Versioning - 24, // 6: pbfs.FeedWatchMessage.api_version:type_name -> pbbase.Versioning - 23, // 7: pbfs.AppMeta.labels:type_name -> pbfs.AppMeta.LabelsEntry - 25, // 8: pbfs.FileMeta.commit_spec:type_name -> pbcommit.CommitSpec - 26, // 9: pbfs.FileMeta.config_item_spec:type_name -> pbci.ConfigItemSpec - 27, // 10: pbfs.FileMeta.config_item_attachment:type_name -> pbci.ConfigItemAttachment + 27, // 3: pbfs.HandshakeResp.api_version:type_name -> pbbase.Versioning + 27, // 4: pbfs.MessagingMeta.api_version:type_name -> pbbase.Versioning + 27, // 5: pbfs.SideWatchMeta.api_version:type_name -> pbbase.Versioning + 27, // 6: pbfs.FeedWatchMessage.api_version:type_name -> pbbase.Versioning + 26, // 7: pbfs.AppMeta.labels:type_name -> pbfs.AppMeta.LabelsEntry + 28, // 8: pbfs.FileMeta.commit_spec:type_name -> pbcommit.CommitSpec + 29, // 9: pbfs.FileMeta.config_item_spec:type_name -> pbci.ConfigItemSpec + 30, // 10: pbfs.FileMeta.config_item_attachment:type_name -> pbci.ConfigItemAttachment 9, // 11: pbfs.FileMeta.repository_spec:type_name -> pbfs.RepositorySpec - 24, // 12: pbfs.PullAppFileMetaReq.api_version:type_name -> pbbase.Versioning + 27, // 12: pbfs.PullAppFileMetaReq.api_version:type_name -> pbbase.Versioning 7, // 13: pbfs.PullAppFileMetaReq.app_meta:type_name -> pbfs.AppMeta 8, // 14: pbfs.PullAppFileMetaResp.repository:type_name -> pbfs.Repository 10, // 15: pbfs.PullAppFileMetaResp.file_metas:type_name -> pbfs.FileMeta - 28, // 16: pbfs.PullAppFileMetaResp.pre_hook:type_name -> pbhook.HookSpec - 28, // 17: pbfs.PullAppFileMetaResp.post_hook:type_name -> pbhook.HookSpec - 24, // 18: pbfs.GetDownloadURLReq.api_version:type_name -> pbbase.Versioning + 31, // 16: pbfs.PullAppFileMetaResp.pre_hook:type_name -> pbhook.HookSpec + 31, // 17: pbfs.PullAppFileMetaResp.post_hook:type_name -> pbhook.HookSpec + 27, // 18: pbfs.GetDownloadURLReq.api_version:type_name -> pbbase.Versioning 10, // 19: pbfs.GetDownloadURLReq.file_meta:type_name -> pbfs.FileMeta - 29, // 20: pbfs.App.revision:type_name -> pbbase.Revision + 32, // 20: pbfs.App.revision:type_name -> pbbase.Revision 15, // 21: pbfs.ListAppsResp.apps:type_name -> pbfs.App 7, // 22: pbfs.PullKvMetaReq.app_meta:type_name -> pbfs.AppMeta 20, // 23: pbfs.PullKvMetaResp.kv_metas:type_name -> pbfs.KvMeta - 29, // 24: pbfs.KvMeta.revision:type_name -> pbbase.Revision - 30, // 25: pbfs.KvMeta.kv_attachment:type_name -> pbkv.KvAttachment + 32, // 24: pbfs.KvMeta.revision:type_name -> pbbase.Revision + 33, // 25: pbfs.KvMeta.kv_attachment:type_name -> pbkv.KvAttachment 7, // 26: pbfs.GetKvValueReq.app_meta:type_name -> pbfs.AppMeta - 1, // 27: pbfs.Upstream.Handshake:input_type -> pbfs.HandshakeMessage - 3, // 28: pbfs.Upstream.Messaging:input_type -> pbfs.MessagingMeta - 5, // 29: pbfs.Upstream.Watch:input_type -> pbfs.SideWatchMeta - 11, // 30: pbfs.Upstream.PullAppFileMeta:input_type -> pbfs.PullAppFileMetaReq - 13, // 31: pbfs.Upstream.GetDownloadURL:input_type -> pbfs.GetDownloadURLReq - 18, // 32: pbfs.Upstream.PullKvMeta:input_type -> pbfs.PullKvMetaReq - 21, // 33: pbfs.Upstream.GetKvValue:input_type -> pbfs.GetKvValueReq - 16, // 34: pbfs.Upstream.ListApps:input_type -> pbfs.ListAppsReq - 2, // 35: pbfs.Upstream.Handshake:output_type -> pbfs.HandshakeResp - 4, // 36: pbfs.Upstream.Messaging:output_type -> pbfs.MessagingResp - 6, // 37: pbfs.Upstream.Watch:output_type -> pbfs.FeedWatchMessage - 12, // 38: pbfs.Upstream.PullAppFileMeta:output_type -> pbfs.PullAppFileMetaResp - 14, // 39: pbfs.Upstream.GetDownloadURL:output_type -> pbfs.GetDownloadURLResp - 19, // 40: pbfs.Upstream.PullKvMeta:output_type -> pbfs.PullKvMetaResp - 22, // 41: pbfs.Upstream.GetKvValue:output_type -> pbfs.GetKvValueResp - 17, // 42: pbfs.Upstream.ListApps:output_type -> pbfs.ListAppsResp - 35, // [35:43] is the sub-list for method output_type - 27, // [27:35] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 7, // 27: pbfs.GetKvValuesReq.app_meta:type_name -> pbfs.AppMeta + 23, // 28: pbfs.GetKvValuesResp.kvs:type_name -> pbfs.KV + 1, // 29: pbfs.Upstream.Handshake:input_type -> pbfs.HandshakeMessage + 3, // 30: pbfs.Upstream.Messaging:input_type -> pbfs.MessagingMeta + 5, // 31: pbfs.Upstream.Watch:input_type -> pbfs.SideWatchMeta + 11, // 32: pbfs.Upstream.PullAppFileMeta:input_type -> pbfs.PullAppFileMetaReq + 13, // 33: pbfs.Upstream.GetDownloadURL:input_type -> pbfs.GetDownloadURLReq + 18, // 34: pbfs.Upstream.PullKvMeta:input_type -> pbfs.PullKvMetaReq + 21, // 35: pbfs.Upstream.GetKvValue:input_type -> pbfs.GetKvValueReq + 24, // 36: pbfs.Upstream.GetKvValues:input_type -> pbfs.GetKvValuesReq + 16, // 37: pbfs.Upstream.ListApps:input_type -> pbfs.ListAppsReq + 2, // 38: pbfs.Upstream.Handshake:output_type -> pbfs.HandshakeResp + 4, // 39: pbfs.Upstream.Messaging:output_type -> pbfs.MessagingResp + 6, // 40: pbfs.Upstream.Watch:output_type -> pbfs.FeedWatchMessage + 12, // 41: pbfs.Upstream.PullAppFileMeta:output_type -> pbfs.PullAppFileMetaResp + 14, // 42: pbfs.Upstream.GetDownloadURL:output_type -> pbfs.GetDownloadURLResp + 19, // 43: pbfs.Upstream.PullKvMeta:output_type -> pbfs.PullKvMetaResp + 22, // 44: pbfs.Upstream.GetKvValue:output_type -> pbfs.GetKvValueResp + 25, // 45: pbfs.Upstream.GetKvValues:output_type -> pbfs.GetKvValuesResp + 17, // 46: pbfs.Upstream.ListApps:output_type -> pbfs.ListAppsResp + 38, // [38:47] is the sub-list for method output_type + 29, // [29:38] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_feed_server_proto_init() } @@ -2049,6 +2247,42 @@ func file_feed_server_proto_init() { return nil } } + file_feed_server_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_feed_server_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetKvValuesReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_feed_server_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetKvValuesResp); 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{ @@ -2056,7 +2290,7 @@ func file_feed_server_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_feed_server_proto_rawDesc, NumEnums: 0, - NumMessages: 24, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.proto b/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.proto index aff44d6d0e..be572ceb32 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.proto +++ b/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server.proto @@ -19,6 +19,7 @@ service Upstream { rpc GetDownloadURL(GetDownloadURLReq) returns (GetDownloadURLResp) {} rpc PullKvMeta(PullKvMetaReq) returns (PullKvMetaResp) {} rpc GetKvValue(GetKvValueReq) returns (GetKvValueResp) {} + rpc GetKvValues(GetKvValuesReq) returns (GetKvValuesResp) {} rpc ListApps(ListAppsReq) returns (ListAppsResp) {} } @@ -178,3 +179,19 @@ message GetKvValueResp { string kv_type = 1; string value = 2; } + +message KV { + string key = 1; + string kv_type = 2; + string value = 3; +} + +message GetKvValuesReq { + uint32 biz_id = 1; + AppMeta app_meta = 2; + repeated string keys = 3; +} + +message GetKvValuesResp { + repeated KV kvs = 1; +} diff --git a/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server_grpc.pb.go b/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server_grpc.pb.go index 945d157e82..9b65f281b3 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server_grpc.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/feed-server/feed_server_grpc.pb.go @@ -26,6 +26,7 @@ const ( Upstream_GetDownloadURL_FullMethodName = "/pbfs.Upstream/GetDownloadURL" Upstream_PullKvMeta_FullMethodName = "/pbfs.Upstream/PullKvMeta" Upstream_GetKvValue_FullMethodName = "/pbfs.Upstream/GetKvValue" + Upstream_GetKvValues_FullMethodName = "/pbfs.Upstream/GetKvValues" Upstream_ListApps_FullMethodName = "/pbfs.Upstream/ListApps" ) @@ -41,6 +42,7 @@ type UpstreamClient interface { GetDownloadURL(ctx context.Context, in *GetDownloadURLReq, opts ...grpc.CallOption) (*GetDownloadURLResp, error) PullKvMeta(ctx context.Context, in *PullKvMetaReq, opts ...grpc.CallOption) (*PullKvMetaResp, error) GetKvValue(ctx context.Context, in *GetKvValueReq, opts ...grpc.CallOption) (*GetKvValueResp, error) + GetKvValues(ctx context.Context, in *GetKvValuesReq, opts ...grpc.CallOption) (*GetKvValuesResp, error) ListApps(ctx context.Context, in *ListAppsReq, opts ...grpc.CallOption) (*ListAppsResp, error) } @@ -138,6 +140,15 @@ func (c *upstreamClient) GetKvValue(ctx context.Context, in *GetKvValueReq, opts return out, nil } +func (c *upstreamClient) GetKvValues(ctx context.Context, in *GetKvValuesReq, opts ...grpc.CallOption) (*GetKvValuesResp, error) { + out := new(GetKvValuesResp) + err := c.cc.Invoke(ctx, Upstream_GetKvValues_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *upstreamClient) ListApps(ctx context.Context, in *ListAppsReq, opts ...grpc.CallOption) (*ListAppsResp, error) { out := new(ListAppsResp) err := c.cc.Invoke(ctx, Upstream_ListApps_FullMethodName, in, out, opts...) @@ -159,6 +170,7 @@ type UpstreamServer interface { GetDownloadURL(context.Context, *GetDownloadURLReq) (*GetDownloadURLResp, error) PullKvMeta(context.Context, *PullKvMetaReq) (*PullKvMetaResp, error) GetKvValue(context.Context, *GetKvValueReq) (*GetKvValueResp, error) + GetKvValues(context.Context, *GetKvValuesReq) (*GetKvValuesResp, error) ListApps(context.Context, *ListAppsReq) (*ListAppsResp, error) } @@ -187,6 +199,9 @@ func (UnimplementedUpstreamServer) PullKvMeta(context.Context, *PullKvMetaReq) ( func (UnimplementedUpstreamServer) GetKvValue(context.Context, *GetKvValueReq) (*GetKvValueResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetKvValue not implemented") } +func (UnimplementedUpstreamServer) GetKvValues(context.Context, *GetKvValuesReq) (*GetKvValuesResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKvValues not implemented") +} func (UnimplementedUpstreamServer) ListApps(context.Context, *ListAppsReq) (*ListAppsResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListApps not implemented") } @@ -331,6 +346,24 @@ func _Upstream_GetKvValue_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Upstream_GetKvValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetKvValuesReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UpstreamServer).GetKvValues(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Upstream_GetKvValues_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UpstreamServer).GetKvValues(ctx, req.(*GetKvValuesReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Upstream_ListApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAppsReq) if err := dec(in); err != nil { @@ -380,6 +413,10 @@ var Upstream_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetKvValue", Handler: _Upstream_GetKvValue_Handler, }, + { + MethodName: "GetKvValues", + Handler: _Upstream_GetKvValues_Handler, + }, { MethodName: "ListApps", Handler: _Upstream_ListApps_Handler,