alioss

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

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

Go to latest
Published: Aug 15, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

README

ali_oss

api for https://github.com/aliyun/aliyun-oss-go-sdk

Client 客户端API说明

type Client interface {
	// 生成文件Oss路径
	GenObjectID(prefixPath, filename string) string
	// 上传文件
	PutObject(bucketName, objectID string, reader io.Reader) error
	// 获取文件地址
	GetSignURL(bucketName, objectID string, options ...oss.Option) (string, error)
	// 删除文件地址
	DeleteObject(bucketName, objectID string) error
	// 获取所有object列表
	ListObjects(bucketName string) (*oss.ListObjectsResult, error)
}

client, _ := NewClientFromFile("oss.yaml")

Documentation

Index

Constants

View Source
const (
	AliossPrefix = "oss://"
)

基本参数

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// 生成文件Oss路径
	GenObjectID(prefixPath, filename string) string
	// 上传文件
	PutObject(bucketName, objectID string, reader io.Reader) error
	// 获取文件地址
	GetSignURL(bucketName, objectID string, options ...oss.Option) (string, error)
	// 删除文件地址
	DeleteObject(bucketName, objectID string) error
	// 获取所有object列表
	ListObjects(bucketName string) (*oss.ListObjectsResult, error)
}

Client 客户端API说明

func NewClient

func NewClient(accessID, accessKey, endPoint string, expireSeconds int64) (Client, error)

NewClient 获取新的客户端

func NewClientFromFile

func NewClientFromFile(filePath string) (Client, error)

NewClientFromFile 从配置文件读取

Jump to

Keyboard shortcuts

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