Documentation ¶
Overview ¶
权限控制 https://help.aliyun.com/document_detail/609913.html
下载文件 https://help.aliyun.com/document_detail/32148.html
列举文件 https://help.aliyun.com/document_detail/88639.html
oss客户端,必须先调用 Init 初始化 https://help.aliyun.com/product/31815.html https://help.aliyun.com/document_detail/32144.html
Index ¶
- Constants
- Variables
- func Download(objectKey string, options ...oss.Option) error
- func GetObject(objectKey string, options ...oss.Option) ([]byte, error)
- func GetObjectStr(objectKey string, options ...oss.Option) (string, error)
- func Init(endpoint, accessKeyID, accessKeySecret, bucketName string) error
- func InitEnv() error
- func ListObjects(prefix string) ([]oss.ObjectProperties, error)
- func Modify(f func([]byte) []byte, objectKey string, options ...oss.Option) error
- func PutObject(objectKey string, reader io.Reader, options ...oss.Option) error
- func PutObjectBytes(objectKey string, bs []byte, options ...oss.Option) error
- func PutObjectFromFile(objectKey, filePath string, options ...oss.Option) error
- func PutObjectFromFileACL(objectKey, filePath string, acl oss.ACLType) error
- func PutObjectString(objectKey string, s string, options ...oss.Option) error
- func SignURL(objectKey string, expiredInSec int64, options ...oss.Option) (string, error)
- func VideoSnapshot(width, height int) string
- func VideoSnapshotSignURL(objectKey string, expiredInSec int64, width, height int) (string, error)
Constants ¶
const ( ACLPrivate = oss.ACLPrivate // 私有读,私有写,bucket默认 ACLPublicRead = oss.ACLPublicRead // 公开读,私有写 ACLPublicReadWrite = oss.ACLPublicReadWrite // 公开读,公开写 ACLDefault = oss.ACLDefault // 适用于object,继承bucket权限,object默认 )
Access Control List权限
Variables ¶
var Client *client
Functions ¶
func GetObjectStr ¶
GetObjectStr 读取文件字符串
func Init ¶
Init 初始化oss客户端 endpoint 是oss数据中心地址 例如https://oss-cn-hangzhou.aliyuncs.com https://help.aliyun.com/document_detail/31837.html
func ListObjects ¶
func ListObjects(prefix string) ([]oss.ObjectProperties, error)
ListObjects 获取对象列表,prefix不能以斜杆开头
func PutObjectBytes ¶
PutObjectBytes 将bytes作为文件放到oss
func PutObjectFromFile ¶
PutObjectFromFile 上传本地文件到oss objectKey 不能以斜杆开头
func PutObjectFromFileACL ¶
PutObjectFromFileACL 上传本地文件到oss,并修改acl权限
func PutObjectString ¶
PutObjectString 将字符串作为文件放到oss
func VideoSnapshot ¶
VideoSnapshot 视频截帧参数值 https://help.aliyun.com/document_detail/64555.html 使用视频截帧时,按视频截帧截取的图片数量计费。 截图宽高都指定为0,使用视频宽高,一个指定为0,则自动计算 如果视频可以公开读,截图地址是在视频地址后加 ?x-oss-process=参数值
Types ¶
This section is empty.