Categorygithub.com/lupino/oss-go-sdk
repositorypackage
0.0.0-20151029124810-2127a14b79b3
Repository: https://github.com/lupino/oss-go-sdk.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

oss-go-sdk

Build Status Coveralls

aliyun OSS(open storage service) golang client.

Install

go get -v github.com/Lupino/oss-go-sdk

License

Apache2.0

OSS Usage

OSS, Open Storage Service. Equal to well known Amazon S3.

Create Account

Go to OSS website, 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

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

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:

var realErr = err.(*oss.Error)

Tutorial

API docs

API docs