示例#1
0
/**
 * TestGetChanges
 */
func TestGetChanges() {
	data, err := Database.GetChanges(nil, nil)
	if err != nil {
		panic(err)
	}
	// util.Dumpf("Database Changes >> %+v", data)
	util.Dumpf("Database Changes >> last_seq: %v", data["last_seq"])
	for i, result := range util.DigMapList("results", data) {
		util.Dumps(i, result)
	}
}
示例#2
0
/**
 * TestPing
 */
func TestPing() {
	var doc1 = _document(
		"_id", "25ae622daf825dd1f2ec138b68007a10",
	)
	var doc2 = _document(
		"_id", "25ae622daf825dd1f2ec138b68007a10",
		"_rev", "1-3c92d3e67136c8b206d90ea37a3ee76d",
	)
	util.Dumpf("Document Ping >> %v", doc1.Ping(200))
	util.Dumps("\n---\n")
	util.Dumpf("Document Ping >> %v", doc2.Ping(304))
}
示例#3
0
/**
 * TestClientResponseData.
 */
func TestClientResponseData() {
	type Response struct {
		CouchDB string
		Uuid    string
		Version string
		Vendor  map[string]string
	}

	var response = _doRequest("GET /")
	data, err := response.GetBodyData(&Response{})
	if err != nil {
		util.Dumps(err)
		return
	}
	util.Dumpf("Response Body Parsed >> type: %T value: %+v", data, data)
	util.Dumpf("Response Body Parsed >> couchdb: %s", data.(*Response).CouchDB)
	util.Dumpf("Response Body Parsed >> uuid: %s", data.(*Response).Uuid)
	util.Dumpf("Response Body Parsed >> version: %s", data.(*Response).Version)
	util.Dumpf("Response Body Parsed >> vendor: %s", data.(*Response).Vendor)
	util.Dumpf("Response Body Parsed >> vendor.name: %s", data.(*Response).Vendor["name"])
	util.Dumpf("Response Body Parsed >> vendor.version: %s", data.(*Response).Vendor["version"])
}
示例#4
0
/**
 * TestGetLogs
 */
func TestGetLogs() {
	var data = Server.GetLogs(nil)
	util.Dumps(data)
}