You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/08/29 08:41:38 UTC

[GitHub] [servicecomb-kie] surechen opened a new issue #27: Kie client can't get value.

surechen opened a new issue #27: Kie client can't get value.
URL: https://github.com/apache/servicecomb-kie/issues/27
 
 
   I do following program. The result is kvList   &{ObjectID("000000000000000000000000")      map[]  0 }.
   package main
   
   import (
   	"context"
   	"fmt"
   	"github.com/apache/servicecomb-kie/pkg/model"
   	"github.com/apache/servicecomb-kie/client"
   )
   
   func main() {
   	config := client.Config {
   		Endpoint:   "http://127.0.0.1:30110",
   		VerifyPeer:   false, //TODO make it works, now just keep it false
   	}
   	clients, err := client.New(config)
   	if err != nil {
   		fmt.Println(" new err", err.Error())
   	}
   	kvBody := model.KVDoc{}
   	kvBody.Key = "hellomesher"
   	kvBody.Value = "100s"
   	kvBody.ValueType = "string"
   	kvBody.Project = "test"
   	kvBody.Labels = make(map[string]string)
   	kvBody.Labels["evn"] = "test"
   
   
   	kvInfo, err := clients.Put(context.TODO(), kvBody, client.WithProject("test"))
   	if err != nil {
   		fmt.Println(" put err", err.Error(), kvInfo)
   	}
   
   	kvList, err := clients.Get(context.TODO(),"hellomesher", client.WithGetProject("test"))
   	if err != nil {
   		fmt.Println(" get err", err.Error())
   	}
   	for _, info  := range kvList {
   		fmt.Println("kvList", info.Key, info.Value, info)
   		for key, value := range info.Labels {
   			fmt.Println("key value ", key, value)
   		}
   	}
   
   
   
   }

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services