目录

Installing


Install your specific service package with the following go get command. You can install the entire SDK by installing the root package:

$ go get github.com/XiaoMi/galaxy-sdk-go

Configuring Credential


Before using the SDK, ensure that you’ve configured credential. You can get the necessary credential by registering on http://dev.xiaomi.com/. To configure credential, you may use codes like:

appKey := "MY-APP-KEY"
appSecret := "MY-SECRET-KEY"
userType := auth.UserType_APP_SECRET
cred := auth.Credential{&userType, &appKey, thrift.StringPtr(appSecret)}

Usage


To use SDK, you can import like:

import (
    "github.com/XiaoMi/galaxy-sdk-go/sds/auth"
    "github.com/XiaoMi/galaxy-sdk-go/sds/common"
    "github.com/XiaoMi/galaxy-sdk-go/sds/client"
    "github.com/XiaoMi/galaxy-sdk-go/sds/table"
    "github.com/XiaoMi/galaxy-sdk-go/thrift"
    "github.com/XiaoMi/galaxy-sdk-go/sds/errors"
)

We have an example in examples/basic.go, users can run this example after credential configured:

$ cd examples
$ go get
$ go run basic.go
关于
498.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号