Help us shape the future of Go! Take the 2026 Go Developer Survey

alioss

package module
v0.0.0-...-d3f2357 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2014 License: MIT Imports: 14 Imported by: 11

README

ali-oss

Go(Golang) wrapper for aliyun OSS(Open Storage Service) RESTful API.

Documentation

Overview

Package aliyun OSS API.

Index

Constants

View Source
const (
	REGION_QINGDAO           BucketRegion = "oss-cn-qingdao.aliyuncs.com"
	REGION_QINGDAO_INTERNAL               = "oss-cn-qingdao-internal.aliyuncs.com"
	REGION_HANGZHOU                       = "oss-cn-hangzhou.aliyuncs.com"
	REGION_HANGZHOU_INTERNAL              = "oss-cn-hangzhou-internal.aliyuncs.com"
	REGION_BEIJING                        = "oss-cn-beijing.aliyuncs.com"
	REGION_BEIJING_INTERNAL               = "oss-cn-beijing-internal.aliyuncs.com"
)
View Source
const (
	ACL_PRIVATE   ACL = "private"
	ACL_PUBLIC_R      = "public-read"
	ACL_PUBLIC_RW     = "public-read-write"
)
View Source
const Version = "developing"

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL string

type Bucket

type Bucket struct {
	*Client
	// contains filtered or unexported fields
}

Holds OSS bucket informations

func NewBucket

func NewBucket(name string, region BucketRegion, client *Client) *Bucket

Initialize a new OSS bucket with the given `name`, `region` and `*Client`.

func (*Bucket) Delete

func (b *Bucket) Delete(object string) error

DELETE the given `object`.

func (*Bucket) Put

func (b *Bucket) Put(object string, content io.Reader, headers map[string]string) error

PUT the given `content` as `object`.

func (*Bucket) PutFile

func (b *Bucket) PutFile(object, filepath string, headers map[string]string) error

PUT the file at `filepath` to `object`.

type BucketRegion

type BucketRegion string

Bucket region enum.

type Client

type Client struct {
	*http.Client
	// contains filtered or unexported fields
}

Holds OSS client informations

func NewClient

func NewClient(accessKeyId, accessKeySecret string) *Client

Initialize a new client and sets access_key_id and access_key_secret.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL