https://github.com/morlay/goaliyun
https://github.com/morlay/goaliyun
aliyun go
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/morlay/goaliyun
- Owner: morlay
- Created: 2018-06-07T09:50:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T01:30:33.000Z (about 8 years ago)
- Last Synced: 2025-02-25T22:15:54.444Z (over 1 year ago)
- Topics: aliyun, go
- Language: Go
- Size: 816 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Aliyun SDK for go
## How to
``` sh
git clone ...
# initial
git submodule update --init
gradle
# update
git submodule update --remote
gradle
```
## Issues
* Just PRC
## Usage
```go
package main
import (
"os"
"fmt"
"time"
"github.com/morlay/goaliyun"
"github.com/morlay/goaliyun/clients/vpc"
)
func main() {
client := goaliyun.NewClientWithCredential(
os.Getenv("ALIYUN_ACCESS_KEY"),
os.Getenv("ALIYUN_SECRET_KEY"),
// optional config timeout
goaliyun.ClientOptionWithTimeout(1 * time.Hour),
// log each request
goaliyun.ClientOptionWithTransports(
goaliyun.NewLogTransport(),
// or define your own transport
),
)
req := vpc.DescribeRegionsRequest{
RegionId: "cn-beijing",
}
resp, err := req.Invoke(client)
if err != nil {
panic(err)
}
fmt.Printf("%v", resp.Regions)
}
```