目录

BaiduCloud SDK for Go

GoDoc Build Status Go Report Card

This sdk is still under development and may be changed frequently.

baiudcloud-sdk-go is the official BaiudCloud SDK for the Go programming language, supporting convenient access to cloud resources, including Baidu Cloud Compute (BCC), Baidu Load Balancer (BLB), Baidu Object Storage (BOS), Cloud Disk Service (CDS), Elastic IP (EIP), Virtual Private Cloud (VPC), etc.

Installing

Go >= 1.8 is required.

go get -u github.com/baidu/baiducloud-sdk-go/...

Usage

This example shows a complete example to list all eips in some region.

package main

import (
    "fmt"
    "time"

    "github.com/baidu/baiducloud-sdk-go/bce"
    "github.com/baidu/baiducloud-sdk-go/eip"
)

func main() {
    cred, err := bce.NewCredentialsFromFile("example/main/aksk.json")
    if err != nil {
        panic(err)
    }
    bceConf := &bce.Config{
        Credentials: cred,
        Checksum:    true,
        Timeout:     5 * time.Second,
        Region:      "bj",
    }

    eipClient := eip.NewEIPClient(bceConf)
    eipClient.SetDebug(true)
    eips, err := eipClient.GetEips(nil, nil)
    if err != nil {
        panic(err)
    }
    for idx, ip := range eips {
        fmt.Printf("%d, %s\n", idx, ip.Eip)
    }
    return
}

Contributors

  • Guoyao Wu @guoyao
  • Guoyan Chen @drinktee
  • Yuxiao Song
  • Hongbin Mao @hello2mao
  • Yang Meng @m3ngyang
  • Weidong Cai @cwdsuzhou

License

This SDK is distributed under the Apache License, Version 2.0.

关于
179.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

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