Skip to content

dongzeli95/tcb-openapi-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kaylyu/tcb-openapi-go

Cloudbase Open API development sdk written in Golang

快速开始

import github.com/dongzeli95/tcb-openapi-go

示例

tcb := tcb.NewTcb(&config.Config{
    EnvId:     "",                              //云开发环境ID
    Timeout:   time.Duration(15) * time.Second, //请求超时
    LogPrefix: "tcb",                           //日志头
    Debug:     false,                           //接口是否开启DEBUG
    SecretId:"",                                //腾讯云密钥SecretId
    SecretKey:"",                               //腾讯云密钥SecretKey
})

//根据文档ID查找对应云数据库表中记录
fmt.Println(client.GetDatabase().GetDocument("users", "124444", 10, 0, nil, nil))

//调用云函数
fmt.Println(tcb.GetFunction().Invoke("test_func", map[string]interface{}{
    "data": map[string]interface{}{
        "path":       "/ping",
        "httpMethod": "GET",
        "body":       "",
    },
}))

支持

  • 云函数
  • 文件存储
  • 数据库 示例

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages