123yangxiong commented on code in PR #268:
URL: https://github.com/apache/servicecomb-kie/pull/268#discussion_r1029159073


##########
server/datasource/etcd/kv/kv_dao.go:
##########
@@ -507,6 +507,50 @@ func (s *Dao) List(ctx context.Context, project, domain 
string, options ...datas
        return pagingResult(result, opts), nil
 }
 
+func (s *Dao) ListNoAuth(ctx context.Context, project, domain string, options 
...datasource.FindOption) (*model.KVResponse, error) {

Review Comment:
   已改为在opts中传入参数判断是否校验



##########
server/datasource/etcd/kv/kv_dao.go:
##########
@@ -507,6 +507,50 @@ func (s *Dao) List(ctx context.Context, project, domain 
string, options ...datas
        return pagingResult(result, opts), nil
 }
 
+func (s *Dao) ListNoAuth(ctx context.Context, project, domain string, options 
...datasource.FindOption) (*model.KVResponse, error) {
+       opts := datasource.NewDefaultFindOpts()
+       for _, o := range options {
+               o(&opts)
+       }
+       ctx, cancel := context.WithTimeout(ctx, opts.Timeout)
+       defer cancel()
+
+       regex, err := toRegex(opts)
+       if err != nil {
+               return nil, err
+       }
+       // TODO may be OOM
+       kvs, _, err := etcdadpt.List(ctx, key.KVList(domain, project))
+       if err != nil {
+               openlog.Error("list kv failed: " + err.Error())
+               return nil, err
+       }
+       result := &model.KVResponse{
+               Data: []*model.KVDoc{},
+       }
+       for _, kv := range kvs {

Review Comment:
   已改为在opts中传入参数判断是否校验



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to