Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bmob/bmob-go-sdk
Bmob Go SDK
https://github.com/bmob/bmob-go-sdk
Last synced: 3 months ago
JSON representation
Bmob Go SDK
- Host: GitHub
- URL: https://github.com/bmob/bmob-go-sdk
- Owner: bmob
- License: gpl-2.0
- Created: 2015-12-11T04:06:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-23T01:10:11.000Z (almost 9 years ago)
- Last Synced: 2024-07-16T14:02:51.773Z (4 months ago)
- Language: Go
- Size: 16.6 KB
- Stars: 6
- Watchers: 15
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bmob Go SDK开发文档
===============
本文档是Bmob官方提供的Go SDK,方便Go开发人员快速使用Bmob进行后端开发。
## 准备工作
### SDK下载
go get github.com/bmob/bmob-go-sdk
## 运行效果
打开项目中的`examples/main.go`文件,可以看到如何使用Go SDK相关的方法。
```
package mainimport (
"log""github.com/bmob/bmob-go-sdk"
)var (
appConfig = bmob.RestConfig{"",
""}
)type TestData struct {
Score string
//data DataType
}type MyRes struct {
bmob.RestResponse
bmob.ImageResponse
}type TestDataRes struct {
TestData
MyRes
}func main() {
a := bmob.RestResponse{}
log.Println(a)
log.Println("****************************************")
var respDst = TestDataRes{}header, err := bmob.DoRestReq(appConfig,
bmob.RestRequest{
bmob.BaseReq{
"GET",
bmob.ApiRestURL("GameScore") + "/",
""},
"application/json",
nil},
&respDst)
if err == nil {
log.Println(header)
log.Println(respDst)
} else {
log.Panic(err)
}log.Println("****************************************")
}
```## 类库说明
* RestConfig
Bmob配置类,使用的时候需要修改里面的配置信息
* 数据类型
Bmob预定义的数据类型,用户可在此基础上进行定制* DoRestRequest
Bmob基础方法,用于完成REST API请求
# Bmob官方信息
官方网址:[http://www.bmob.cn](http://www.bmob.cn)
问答社区:[http://wenda.bmob.cn](http://wenda.bmob.cn)
技术邮箱:[email protected]
=======