README
¶
KSC SDK for Go
概述
- 金山云Go语言SDK
- Go语言版本1.5+ 推荐是用1.12+ 这样方便使用govendor
- service目录下的文件请不要修改,都是由代码生成器自动生成 代码生成器暂时不开源
- 如果使用vendor 请确保所有ksc-sdk-go 在GOPATH下面/src/github.com/KscSDK目录下 ($GOPATH/src/github.com/KscSDK)
vendor
使用vendor(Go 1.5+)做依赖的话可以直接使用本sdk工具
Go 1.5
需要去AWS-SDK-GO 下载后,拷贝aws-sdk-go到在GOPATH下面/src/github.com/aws目录下 ($GOPATH/src/github.com/aws)目录下 或者使用 go get github.com/aws/aws-sdk-go
代码示例
UseInternal:true 代表使用金山云内网域名
代码示例在example目录下
ak := "用户AK"
sk := "用户SK"
region := "cn-beijing-6"
svc := vpc.SdkNew(ksc.NewClient(ak, sk), &ksc.Config{Region: ®ion}, &utils.UrlInfo{
UseSSL: true,
UseInternal:true,
})
//创建入参 参考 https://docs.ksyun.com/
m_vpc := make(map[string]interface{})
m_vpc["VpcId.1"] = "VPCID"
//查询VPC信息
resp, err := svc.DescribeVpcs(&m_vpc)
if err != nil {
fmt.Println("there was an error listing instances in", err.Error())
}
if resp != nil {
l := (*resp)["VpcSet"].([]interface{})
for i := 0; i < len(l); i++ {
item := l[i].(map[string]interface{})
fmt.Printf("%+v:%+v\n", item["VpcId"], item["VpcName"])
}
}
//创建入参 参考 https://docs.ksyun.com/
m_vnet := make(map[string]interface{})
//查询子网信息
resp1, err1 := svc.DescribeSubnets(&m_vnet)
if err1 != nil {
fmt.Println("there was an error listing instances in", err1.Error())
}
if resp1 != nil {
l := (*resp1)["SubnetSet"].([]interface{})
for i := 0; i < len(l); i++ {
item := l[i].(map[string]interface{})
fmt.Printf("%+v:%+v\n", item["SubnetId"], item["SubnetName"])
}
}
Directories
¶
Path | Synopsis |
---|---|
example
|
|
service
|
|
dedicated/dedicatediface
Package dedicatediface provides an interface to enable mocking the dedicated service client for testing your code.
|
Package dedicatediface provides an interface to enable mocking the dedicated service client for testing your code. |
dns/dnsiface
Package dnsiface provides an interface to enable mocking the dns service client for testing your code.
|
Package dnsiface provides an interface to enable mocking the dns service client for testing your code. |
ebs/ebsiface
Package ebsiface provides an interface to enable mocking the ebs service client for testing your code.
|
Package ebsiface provides an interface to enable mocking the ebs service client for testing your code. |
eip/eipiface
Package eipiface provides an interface to enable mocking the eip service client for testing your code.
|
Package eipiface provides an interface to enable mocking the eip service client for testing your code. |
epc/epciface
Package epciface provides an interface to enable mocking the epc service client for testing your code.
|
Package epciface provides an interface to enable mocking the epc service client for testing your code. |
iam/iamiface
Package iamiface provides an interface to enable mocking the iam service client for testing your code.
|
Package iamiface provides an interface to enable mocking the iam service client for testing your code. |
kce/kceiface
Package kceiface provides an interface to enable mocking the kce service client for testing your code.
|
Package kceiface provides an interface to enable mocking the kce service client for testing your code. |
kcm/kcmiface
Package kcmiface provides an interface to enable mocking the kcm service client for testing your code.
|
Package kcmiface provides an interface to enable mocking the kcm service client for testing your code. |
kcsv1/kcsv1iface
Package kcsv1iface provides an interface to enable mocking the kcsv1 service client for testing your code.
|
Package kcsv1iface provides an interface to enable mocking the kcsv1 service client for testing your code. |
kcsv2/kcsv2iface
Package kcsv2iface provides an interface to enable mocking the kcsv2 service client for testing your code.
|
Package kcsv2iface provides an interface to enable mocking the kcsv2 service client for testing your code. |
kec/keciface
Package keciface provides an interface to enable mocking the kec service client for testing your code.
|
Package keciface provides an interface to enable mocking the kec service client for testing your code. |
krds/krdsiface
Package krdsiface provides an interface to enable mocking the krds service client for testing your code.
|
Package krdsiface provides an interface to enable mocking the krds service client for testing your code. |
ksms/ksmsiface
Package ksmsiface provides an interface to enable mocking the ksms service client for testing your code.
|
Package ksmsiface provides an interface to enable mocking the ksms service client for testing your code. |
memcached/memcachediface
Package memcachediface provides an interface to enable mocking the memcached service client for testing your code.
|
Package memcachediface provides an interface to enable mocking the memcached service client for testing your code. |
mongodb/mongodbiface
Package mongodbiface provides an interface to enable mocking the mongodb service client for testing your code.
|
Package mongodbiface provides an interface to enable mocking the mongodb service client for testing your code. |
monitor/monitoriface
Package monitoriface provides an interface to enable mocking the monitor service client for testing your code.
|
Package monitoriface provides an interface to enable mocking the monitor service client for testing your code. |
monitorv1/monitorv1iface
Package monitorv1iface provides an interface to enable mocking the monitorv1 service client for testing your code.
|
Package monitorv1iface provides an interface to enable mocking the monitorv1 service client for testing your code. |
monitorv2/monitorv2iface
Package monitorv2iface provides an interface to enable mocking the monitorv2 service client for testing your code.
|
Package monitorv2iface provides an interface to enable mocking the monitorv2 service client for testing your code. |
monitorv3/monitorv3iface
Package monitorv3iface provides an interface to enable mocking the monitorv3 service client for testing your code.
|
Package monitorv3iface provides an interface to enable mocking the monitorv3 service client for testing your code. |
rabbitmq/rabbitmqiface
Package rabbitmqiface provides an interface to enable mocking the rabbitmq service client for testing your code.
|
Package rabbitmqiface provides an interface to enable mocking the rabbitmq service client for testing your code. |
sks/sksiface
Package sksiface provides an interface to enable mocking the sks service client for testing your code.
|
Package sksiface provides an interface to enable mocking the sks service client for testing your code. |
slb/slbiface
Package slbiface provides an interface to enable mocking the slb service client for testing your code.
|
Package slbiface provides an interface to enable mocking the slb service client for testing your code. |
sqlserver/sqlserveriface
Package sqlserveriface provides an interface to enable mocking the sqlserver service client for testing your code.
|
Package sqlserveriface provides an interface to enable mocking the sqlserver service client for testing your code. |
sts/stsiface
Package stsiface provides an interface to enable mocking the sts service client for testing your code.
|
Package stsiface provides an interface to enable mocking the sts service client for testing your code. |
tag/tagiface
Package tagiface provides an interface to enable mocking the tag service client for testing your code.
|
Package tagiface provides an interface to enable mocking the tag service client for testing your code. |
tagv2/tagv2iface
Package tagv2iface provides an interface to enable mocking the tagv2 service client for testing your code.
|
Package tagv2iface provides an interface to enable mocking the tagv2 service client for testing your code. |
vpc/vpciface
Package vpciface provides an interface to enable mocking the vpc service client for testing your code.
|
Package vpciface provides an interface to enable mocking the vpc service client for testing your code. |
Click to show internal directories.
Click to hide internal directories.