项目作者: denverdino

项目描述 :
Go for Aliyun(阿里云) - 适用于ECS,OSS,DNS,SLB,RDS,RAM,MNS,STS,SLS,MQ,Push,OpenSearch,DM,容器服务等的Golang API。
高级语言: Go
项目地址: git://github.com/denverdino/aliyungo.git
创建时间: 2015-04-26T23:42:22Z
项目社区:https://github.com/denverdino/aliyungo

开源协议:Apache License 2.0

下载


AliyunGo: Go SDK for Aliyun Services

Build Status CircleCI Go Report Card

This is an unofficial Go SDK for Aliyun services. You are welcome for contribution.

The official SDK for Aliyun services is published. Please visit https://github.com/aliyun/alibaba-cloud-sdk-go for details

Package Structure

Quick Start

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/denverdino/aliyungo/ecs"
  5. )
  6. const ACCESS_KEY_ID = "<YOUR_ID>"
  7. const ACCESS_KEY_SECRET = "<****>"
  8. func main() {
  9. client := ecs.NewClient(ACCESS_KEY_ID, ACCESS_KEY_SECRET)
  10. fmt.Print(client.DescribeRegions())
  11. }

Documentation

Build and Install

go get:

  1. go get github.com/denverdino/aliyungo

Test ECS

Modify “ecs/config_test.go”

  1. TestAccessKeyId = "MY_ACCESS_KEY_ID"
  2. TestAccessKeySecret = "MY_ACCESS_KEY_ID"
  3. TestInstanceId = "MY_INSTANCE_ID"
  4. TestIAmRich = false
  • TestAccessKeyId: the Access Key Id
  • TestAccessKeySecret: the Access Key Secret.
  • TestInstanceId: the existing instance id for testing. It will be stopped and restarted during testing.
  • TestIAmRich(Optional): If it is set to true, it will perform tests to create virtual machines and disks under your account. And you will pay the bill. :-)

Under “ecs” and run

  1. go test

Test OSS

Modify “oss/config_test.go”

  1. TestAccessKeyId = "MY_ACCESS_KEY_ID"
  2. TestAccessKeySecret = "MY_ACCESS_KEY_ID"
  3. TestRegion = oss.Beijing
  4. TestBucket = "denverdino"
  • TestAccessKeyId: the Access Key Id
  • TestAccessKeySecret: the Access Key Secret.
  • TestRegion: the region of OSS for testing
  • TestBucket: the bucket name for testing

Under “oss” and run

  1. go test

Contributors

License

This project is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

References

The GO API design of OSS refer the implementation from https://github.com/AdRoll/goamz