# tcb-openapi **Repository Path**: cubelab/tcb-openapi ## Basic Information - **Project Name**: tcb-openapi - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-05 - **Last Updated**: 2021-04-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cubelab/tcb-openapi [Cloudbase Open API](https://docs.cloudbase.net/api-reference/openapi/introduction.html#liao-jie-qing-qiu-jie-gou) development sdk written in Golang ### 快速开始 ```go import gitee.com/cubelab/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": "", }, })) ``` ### 支持 - 云函数 - 文件存储 - 数据库 [示例](https://gitee.com/cubelab/tcb-openapi/blob/master/component/database/database_test.go) ### License MIT