本文整理汇总了Golang中couch/util.Dumpf函数的典型用法代码示例。如果您正苦于以下问题:Golang Dumpf函数的具体用法?Golang Dumpf怎么用?Golang Dumpf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Dumpf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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())
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:10,代码来源:client.go
示例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))
}
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:11,代码来源:client.go
示例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)
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:11,代码来源:database.go
示例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])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:11,代码来源:server.go
示例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"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:11,代码来源:document_attachment.go
示例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"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:12,代码来源:document.go
示例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"]))
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:13,代码来源:database.go
示例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))
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:13,代码来源:database.go
示例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"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:13,代码来源:server.go
示例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])
}
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:13,代码来源:server.go
示例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"])
}
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:14,代码来源:server.go
示例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)
}
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:14,代码来源:database.go
示例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"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:14,代码来源:document.go
示例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"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:15,代码来源:database.go
示例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))
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:15,代码来源:document.go
示例16: TestFindRevisions
/**
* TestFindRevisions
*/
func TestFindRevisions() {
var doc = _document(
"_id", "83b5e0a0b3bd41d9a21cee7ae8000615",
)
data, err := doc.FindRevisions()
if err != nil {
panic(err)
}
util.Dumpf("Document Find Revisions >> %v", data)
util.Dumpf("Document Find Revisions >> start: %d", data["start"])
util.Dumpf("Document Find Revisions >> ids: %v", data["ids"])
util.Dumpf("Document Find Revisions >> ids.0: %v", util.Dig("ids.0", data))
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:16,代码来源:document.go
示例17: TestFindRevisionsExtended
/**
* TestFindRevisionsExtended
*/
func TestFindRevisionsExtended() {
var doc = _document(
"_id", "83b5e0a0b3bd41d9a21cee7ae8000615",
)
data, err := doc.FindRevisionsExtended()
if err != nil {
panic(err)
}
util.Dumpf("Document Find Revisions Extended >> %v", data)
util.Dumpf("Document Find Revisions Extended >> 0: %v", data[0])
util.Dumpf("Document Find Revisions Extended >> 0.rev: %s", data[0]["rev"])
util.Dumpf("Document Find Revisions Extended >> 0.status: %s", data[0]["status"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:16,代码来源:document.go
示例18: TestCopyTo
/**
* TestCopyTo
*/
func TestCopyTo() {
var doc = _document(
"_id", "go_test_attc_copy",
"_rev", "1-52f1aa9c34a350b0867ea9e086132647",
)
data, err := doc.CopyTo("go_test_attc_copy_copy", "1-52f1aa9c34a350b0867ea9e086132647")
if err != nil {
panic(err)
}
util.Dumpf("Document Copy To >> %v", data)
util.Dumpf("Document Copy To >> ok: %v", data["ok"])
util.Dumpf("Document Copy To >> id: %v", data["id"])
util.Dumpf("Document Copy To >> rev: %v", data["rev"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:17,代码来源:document.go
示例19: TestRemove
/**
* TestRemove
*/
func TestRemove() {
var doc = _document(
"_id", "e90636c398458a9d5969d2e71b04bc2a",
"_rev", "1-5637fdf6ae62130da1dda54be05d7da7",
)
data, err := doc.Remove()
if err != nil {
panic(err)
}
util.Dumpf("Document Remove >> %v", data)
util.Dumpf("Document Remove >> ok: %v", data["ok"])
util.Dumpf("Document Remove >> id: %v", data["id"])
util.Dumpf("Document Remove >> rev: %v", data["rev"])
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:17,代码来源:document.go
示例20: TestReplicate
/**
* TestReplicate
*/
func TestReplicate() {
data, err := Server.Replicate(map[string]interface{}{
"source": "foo",
"target": "foo_replicate",
"create_target": true,
})
if err != nil {
panic(err)
}
util.Dumpf("Server Database Replicate >> %+v", data)
util.Dumpf("Server Database Replicate >> ok: %v", data["ok"])
util.Dumpf("Server Database Replicate >> history.0: %v", util.Dig("0", data["history"]))
util.Dumpf("Server Database Replicate >> history.0.start_time: %s", util.Dig("0.start_time", data["history"]))
}
开发者ID:yay-couch,项目名称:couch-go,代码行数:17,代码来源:server.go
注:本文中的couch/util.Dumpf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论