Skip to content

Lupino/oss-go-sdk

Repository files navigation

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

About

aliyun OSS(open storage service) golang client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages