本文整理匯總了Golang中couch/util.Dumpf函數的典型用法代碼示例。如果您正苦於以下問題:Golang Dumpf函數的具體用法?Golang Dumpf怎麽用?Golang Dumpf使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Dumpf函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestToString
/**
* TestToString
*/
func TestToString() {
Couch = couch.New(nil, false)
Client = couch.NewClient(Couch)
Client.DoRequest("HEAD /", nil, "", nil)
util.Dumpf("Request\n>>\n%s", Client.GetRequest().ToString())
util.Dumpf("Response\n>>\n%s", Client.GetResponse().ToString())
}
示例2: TestClientResponseHeaders
/**
* TestClientResponseHeaders.
*/
func TestClientResponseHeaders(key string) {
var response = _doRequest("GET /")
if key == "" {
util.Dumpf("Response Headers >> %+v", response.GetHeaderAll())
} else {
util.Dumpf("Response Headers >> %s: %+v", key, response.GetHeader(key))
}
}
示例3: TestEnsureFullCommit
/**
* TestEnsureFullCommit
*/
func TestEnsureFullCommit() {
ok, time, err := Database.EnsureFullCommit()
if err != nil {
panic(err)
}
util.Dumpf("Database Ensure Full Commit >> ok: %v", ok)
util.Dumpf("Database Ensure Full Commit >> instance_start_time: %d", time)
}
示例4: TestGetAllDatabases
/**
* TestGetAllDatabases
*/
func TestGetAllDatabases() {
data, err := Server.GetAllDatabases()
if err != nil {
panic(err)
}
util.Dumpf("Server Databases >> %+v", data)
util.Dumpf("Server Databases >> first: %s", data[0])
}
示例5: TestFind
/**
* TestFind
*/
func TestFind() {
var docAttc = _documentAttachment("./attc.txt", "").Find()
util.Dumpf("Document Attachment Find >> %v", docAttc)
util.Dumpf("Document Attachment Find >> content: %s", docAttc["content"])
util.Dumpf("Document Attachment Find >> content_type: %s", docAttc["content_type"])
util.Dumpf("Document Attachment Find >> content_length: %d", docAttc["content_length"])
util.Dumpf("Document Attachment Find >> digest: %s", docAttc["digest"])
}
示例6: TestFindAttachments
/**
* TestFindAttachments
*/
func TestFindAttachments() {
data, err := _document("_id", "attc_test").FindAttachments(false, nil)
if err != nil {
panic(err)
}
util.Dumpf("Document Find Attachments >> %v", data)
util.Dumpf("Document Find Attachments >> 0: %v", data[0])
util.Dumpf("Document Find Attachments >> 0.content_type: %v", data[0]["content_type"])
}
示例7: TestReplicate
/**
* TestReplicate
*/
func TestReplicate() {
data, err := Database.Replicate("foo_replicate", true)
if err != nil {
panic(err)
}
util.Dumpf("Database Replicate >> %+v", data)
util.Dumpf("Database Replicate >> ok: %v", data["ok"])
util.Dumpf("Database Replicate >> history.0: %v", util.Dig("0", data["history"]))
util.Dumpf("Database Replicate >> history.0.start_time: %s", util.Dig("0.start_time", data["history"]))
}
示例8: TestGetSecurity
/**
* TestGetSecurity
*/
func TestGetSecurity() {
data, err := Database.GetSecurity()
if err != nil {
panic(err)
}
util.Dumpf("Database Get Security >> %+v", data)
util.Dumpf("Database Get Security >> admins %+v", data["admins"])
util.Dumpf("Database Get Security >> admins.names.0 %s", util.Dig("admins.names.0", data))
util.Dumpf("Database Get Security >> admins.roles.0 %s", util.Dig("admins.roles.0", data))
}
示例9: TestGetDatabaseUpdates
/**
* TestGetDatabaseUpdates
*/
func TestGetDatabaseUpdates() {
data, err := Server.GetDatabaseUpdates(nil)
if err != nil {
panic(err)
}
util.Dumpf("Server Updates >> %+v", data)
util.Dumpf("Server Updates >> db_name: %s", data["db_name"])
util.Dumpf("Server Updates >> type: %s", data["type"])
util.Dumpf("Server Updates >> ok: %v", data["ok"])
}
示例10: TestGetUuids
/**
* TestGetUuids
*/
func TestGetUuids() {
data, err := Server.GetUuids(3)
if err != nil {
panic(err)
}
util.Dumpf("Server Uuids >> %+v", data)
for i, _ := range data {
util.Dumpf("Server Uuids >> %d: %s", i, data[i])
}
}
示例11: TestGetActiveTasks
/**
* TestGetActiveTasks
*/
func TestGetActiveTasks() {
data, err := Server.GetActiveTasks()
if err != nil {
panic(err)
}
util.Dumpf("Server Active Tasks >> %+v", data)
for _, task := range data {
util.Dumpf("Server Active Tasks >> 0.pid: %s", task["pid"])
util.Dumpf("Server Active Tasks >> 0.database: %s", task["database"])
}
}
示例12: TestInfo
/**
* TestInfo
*/
func TestInfo() {
data, err := Database.Info()
if err != nil {
panic(err)
}
util.Dumpf("Database Info >> %+v", data)
util.Dumpf("Database Info >> db_name: %s", data["db_name"])
for key, value := range data {
util.Dumpf("Database Info >> %s: %v", key, value)
}
}
示例13: TestFind
/**
* TestFind
*/
func TestFind() {
var doc = _document(
"_id", "25ae622daf825dd1f2ec138b68007a10",
)
data, err := doc.Find(nil)
if err != nil {
panic(err)
}
util.Dumpf("Document Find >> %v", data)
util.Dumpf("Document Find >> _id: %s", data["_id"])
}
示例14: TestPurge
/**
* TestPurge
*/
func TestPurge() {
data, err := Database.Purge(map[string]interface{}{
"667b0208441066a0954717b50c0008a9": []string{
"5-dd1a3738fcbd759ed744f7971fe94332",
},
})
if err != nil {
panic(err)
}
util.Dumpf("Database Purge >> %v", data)
util.Dumpf("Database Purge >> purge_seq: %d", data["purge_seq"])
}
示例15: TestPing
/**
* 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))
}