tcb

package module
v0.0.0-...-41edef4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 9 Imported by: 0

README

cubelab/tcb-openapi

Cloudbase Open API development sdk written in Golang

快速开始
import gitee.com/cubelab/tcb-openapi
示例
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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tcb

type Tcb struct {
	// contains filtered or unexported fields
}

Tcb 实例

func NewTcb

func NewTcb(config *config.Config) *Tcb

创建实例

func (*Tcb) GetDatabase

func (t *Tcb) GetDatabase() *database.Database

接入数据库

func (*Tcb) GetFunction

func (t *Tcb) GetFunction() *functions.Function

接入云函数

func (*Tcb) GetStorage

func (t *Tcb) GetStorage() *storage.Storage

接入云存储

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL