Documentation ¶
Index ¶
- func CreateBucket(bucketName string) (err error)
- func DeleteFile(objectName string) (err error)
- func DownloadFile(objectName string, downloadedFileName string) (err error)
- func GetObject(objectName string, options ...oss.Option) ([]byte, error)
- func OnInit(config map[string]interface{}, option ...Option) (err error)
- func UploadFile(localFileName string, objectName string) (err error)
- func UploadObject(objectKey string, reader io.Reader, options ...oss.Option) (err error)
- type IOSS
- type OSS
- func (this *OSS) CreateBucket(bucketName string) (err error)
- func (this *OSS) DeleteFile(objectName string) (err error)
- func (this *OSS) DownloadFile(objectName string, downloadedFileName string) (err error)
- func (this *OSS) GetObject(objectName string, options ...oss.Option) ([]byte, error)
- func (this *OSS) Init() (err error)
- func (this *OSS) UploadFile(objectName string, localFileName string) (err error)
- func (this *OSS) UploadObject(objectKey string, reader io.Reader, options ...oss.Option) (err error)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBucket ¶
func DeleteFile ¶
func DownloadFile ¶
func UploadFile ¶
Types ¶
type IOSS ¶
type IOSS interface { CreateBucket(bucketName string) (err error) UploadObject(objectKey string, reader io.Reader, options ...oss.Option) (err error) UploadFile(objectName string, localFileName string) (err error) GetObject(objectName string, options ...oss.Option) ([]byte, error) DownloadFile(objectName string, downloadedFileName string) (err error) DeleteFile(objectName string) (err error) }
type OSS ¶
type OSS struct { Endpoint string AccessKeyId string AccessKeySecret string BucketName string // contains filtered or unexported fields }
func (*OSS) DownloadFile ¶
下载文件。 <objectName>从OSS下载文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。
func (*OSS) UploadFile ¶
上传文件 <objectName>上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。 <localFileName>由本地文件路径加文件名包括后缀组成,例如/users/local/myfile.txt。 上传文件。
type Option ¶
type Option func(*Options)
func SetAccessKeyId ¶
func SetAccessKeySecret ¶
func SetBucketName ¶
func SetEndpoint ¶
Click to show internal directories.
Click to hide internal directories.