Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lupino/oss-go-sdk
aliyun OSS(open storage service) golang client.
https://github.com/lupino/oss-go-sdk
Last synced: about 1 month ago
JSON representation
aliyun OSS(open storage service) golang client.
- Host: GitHub
- URL: https://github.com/lupino/oss-go-sdk
- Owner: Lupino
- License: apache-2.0
- Created: 2015-10-21T09:42:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-29T12:48:20.000Z (about 9 years ago)
- Last Synced: 2024-06-20T11:53:43.317Z (6 months ago)
- Language: Go
- Homepage:
- Size: 418 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
oss-go-sdk
==================================[![Build Status](https://travis-ci.org/Lupino/oss-go-sdk.svg?branch=master)](https://travis-ci.org/Lupino/oss-go-sdk)
[![Coveralls](https://coveralls.io/repos/Lupino/oss-go-sdk/badge.png?branch=master)](https://coveralls.io/r/Lupino/oss-go-sdk)aliyun OSS(open storage service) golang client.
## Install
```bash
go get -v github.com/Lupino/oss-go-sdk
```## License
[Apache2.0](LICENSE)
# OSS Usage
OSS, Open Storage Service. Equal to well known Amazon [S3](http://aws.amazon.com/s3/).
## Create Account
Go to [OSS website](http://www.aliyun.com/product/oss/?lang=en), create a new account for new user.
After account created, you can create the OSS instance and get the `accessKeyId` and `accessKeySecret`.
## Initial OSS API
```go
import (
"github.com/Lupino/oss-go-sdk"
)
var APIOptions = oss.GetDefaultAPIOptioins()
APIOptions.AccessID = AccessKeyID
APIOptions.SecretAccessKey = AccessKeySecret
var OSSAPI, err = oss.NewAPI(APIOptions)
```## Get Service
```go
var result oss.ListAllMyBucketsResult
var headers = make(map[string]string)
var err error
err = OSSAPI.GetService(&result, headers)
```## Parse the error
`oss-go-sdk` implement error return by OSS into `error` interface by `oss.Error`,
so you can get error return by OSS server from `oss.Error`, just like:```go
var realErr = err.(*oss.Error)
```## Tutorial
* [Getting start with oss-go-sdk](examples/getting_start)
* [How to create a static website on OSS](examples/website)
* [How to upload file and download file use oss-go-sdk](examples/file_upload_download)
* [A lite notebook use `AppendObject`](examples/notebook)
* [How to upload a large file to OSS](examples/upload_large_file)## API docs
[API docs](https://godoc.org/github.com/Lupino/oss-go-sdk)