RedemptionC commented on issue #2011:
URL: 
https://github.com/apache/apisix-dashboard/issues/2011#issuecomment-891076643


   @nic-chen 
   Hello,it seems that I know how to access content in cache and etcd now
   this is the log output:
   ```
   consumer.Get is called
   in get
   
   cache: key(andy):val(&{andy  map[key-auth:map[key:key-of-john]] map[] 
%!s(int64=1627739045) %!s(int64=1627744978)})
   ......(something else in the cache)
   etcd:  key(andy):val(&{cluster_id:14841639068965178418 
member_id:10276657743932975437 revision:11844 raft_term:38  [] %!s(bool=false) 
%!s(int64=0) {}  %!s(int32=0)})
   
   ```
   and here is my log statement:
   ```go
        fmt.Println("in get")
        s.cache.Range(func(k, v interface{}) bool {
                fmt.Printf("cache: key(%s):val(%s)\n", k, v)
                return true
        })
        val,err:=storage.Client.Get(context.TODO(),key)
        if err!=nil{
                fmt.Println(err)
        }else{
                fmt.Printf("etcd:  key(%s):val(%s)\n", key, val)
        }
   ```
   but they are pretty different, I don't know what the data retrived from etcd 
mean
   but when I use etcdctl,its value is pretty the same as that in the cache:
   ```shell
   ❯ etcdctl get /apisix/consumers/andy         
   /apisix/consumers/andy
   
{"username":"andy","plugins":{"key-auth":{"key":"key-of-john"}},"update_time":1627744978,"create_time":1627739045}
   ```


-- 
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