Documentation ¶
Index ¶
- func CreateDefaultClient(config *Config) error
- func NewClient(cfg *Config) (*aliOss.Client, error)
- func NewStarter() *starter
- func XClient() *oss.Client
- func XFClient(f func(c *oss.Client) error) error
- type BreakPointOss
- func (bp *BreakPointOss) BreakPointDownload(objectKeyName, dstFilePath string) error
- func (bp *BreakPointOss) BreakPointDownloadFromBucket(bucketName, objectKeyName, dstFilePath string) error
- func (bp *BreakPointOss) BreakPointUpload(objectKeyName, localFilePath string) error
- func (bp *BreakPointOss) BreakPointUploadToBucket(bucketName, objectKeyName, localFilePath string) error
- type CommonAliyunOss
- func (c *CommonAliyunOss) AppendUpload(objectKeyName string, appendContents ...string) error
- func (c *CommonAliyunOss) AppendUploadToBucket(bucketName, objectKeyName string, appendContents ...string) error
- func (c *CommonAliyunOss) CompressDownload(objectKeyName, dstFilePath string) error
- func (c *CommonAliyunOss) CompressDownloadFromBucket(bucketName, objectKeyName, dstFilePath string) error
- func (c *CommonAliyunOss) DownLoadFile(objectKeyName, dstFilePath string) error
- func (c *CommonAliyunOss) DownLoadFileFromBucket(bucketName, objectKeyName, dstFilePath string) error
- func (c *CommonAliyunOss) LimitConditionDownload(objectKeyName, dstFilePath string, options ...aliOss.Option) error
- func (c *CommonAliyunOss) LimitConditionDownloadFromBucket(bucketName, objectKeyName, dstFilePath string, options ...aliOss.Option) error
- func (c *CommonAliyunOss) RangeDownload(objectKeyName string, start, end int64) ([]byte, error)
- func (c *CommonAliyunOss) RangeDownloadFromBucket(bucketName, objectKeyName string, start, end int64) ([]byte, error)
- func (c *CommonAliyunOss) StreamDownload(objectKeyName string) ([]byte, error)
- func (c *CommonAliyunOss) StreamDownloadFromBucket(bucketName, objectKeyName string) ([]byte, error)
- func (c *CommonAliyunOss) UploadString(objectKeyName, objectValue string) error
- func (c *CommonAliyunOss) UploadStringToBucket(bucketName, objectKeyName, objectValue string) error
- func (c *CommonAliyunOss) Uploadfile(objectKeyName, localFilePath string) error
- func (c *CommonAliyunOss) UploadfileToBucket(bucketName, objectKeyName, localFilePath string) error
- type Config
- type MultipartOss
- func (mp *MultipartOss) CancelMultipartUpload(objectKeyName string) error
- func (mp *MultipartOss) CancelMultipartUploadToBucket(bucketName, objectKeyName string) error
- func (mp *MultipartOss) MultipartUpload(objectKeyName, localFilePath string) (*aliOss.CompleteMultipartUploadResult, error)
- func (mp *MultipartOss) MultipartUploadToBucket(bucketName, objectKeyName, localFilePath string) (*aliOss.CompleteMultipartUploadResult, error)
- type ProgressOss
- func (p *ProgressOss) ProgressDownload(objectKeyName, dstFilePath string) error
- func (p *ProgressOss) ProgressDownloadFromBucket(bucketName, objectKeyName, dstFilePath string) error
- func (p *ProgressOss) ProgressUpload(objectKeyName, localFilePath string) error
- func (p *ProgressOss) ProgressUploadToBucket(bucketName, objectKeyName, localFilePath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStarter ¶
func NewStarter() *starter
Types ¶
type BreakPointOss ¶
type BreakPointOss struct {
// contains filtered or unexported fields
}
断点上传和断点下载通用操作
func (*BreakPointOss) BreakPointDownload ¶
func (bp *BreakPointOss) BreakPointDownload(objectKeyName, dstFilePath string) error
func (*BreakPointOss) BreakPointDownloadFromBucket ¶ added in v1.2.3
func (bp *BreakPointOss) BreakPointDownloadFromBucket(bucketName, objectKeyName, dstFilePath string) error
func (*BreakPointOss) BreakPointUpload ¶
func (bp *BreakPointOss) BreakPointUpload(objectKeyName, localFilePath string) error
func (*BreakPointOss) BreakPointUploadToBucket ¶ added in v1.2.3
func (bp *BreakPointOss) BreakPointUploadToBucket(bucketName, objectKeyName, localFilePath string) error
type CommonAliyunOss ¶
type CommonAliyunOss struct {
// contains filtered or unexported fields
}
func (*CommonAliyunOss) AppendUpload ¶
func (c *CommonAliyunOss) AppendUpload(objectKeyName string, appendContents ...string) error
func (*CommonAliyunOss) AppendUploadToBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) AppendUploadToBucket(bucketName, objectKeyName string, appendContents ...string) error
追加上传
func (*CommonAliyunOss) CompressDownload ¶
func (c *CommonAliyunOss) CompressDownload(objectKeyName, dstFilePath string) error
func (*CommonAliyunOss) CompressDownloadFromBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) CompressDownloadFromBucket(bucketName, objectKeyName, dstFilePath string) error
文件压缩下载
func (*CommonAliyunOss) DownLoadFile ¶
func (c *CommonAliyunOss) DownLoadFile(objectKeyName, dstFilePath string) error
func (*CommonAliyunOss) DownLoadFileFromBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) DownLoadFileFromBucket(bucketName, objectKeyName, dstFilePath string) error
下载文件到本地
func (*CommonAliyunOss) LimitConditionDownload ¶
func (c *CommonAliyunOss) LimitConditionDownload(objectKeyName, dstFilePath string, options ...aliOss.Option) error
func (*CommonAliyunOss) LimitConditionDownloadFromBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) LimitConditionDownloadFromBucket(bucketName, objectKeyName, dstFilePath string, options ...aliOss.Option) error
限定条件下载
传入options条件参数:
参数 描述 如何设置 IfModifiedSince 如果指定的时间早于实际修改时间,则正常传输文件,否则返回错误(304 Not modified)。 oss.IfModifiedSince IfUnmodifiedSince 如果指定的时间等于或者晚于文件实际修改时间,则正常传输文件,否则返回错误(412 Precondition failed)。 oss.IfUnmodifiedSince IfMatch 如果指定的ETag和OSS文件的ETag匹配,则正常传输文件,否则返回错误(412 Precondition failed)。 oss.IfMatch IfNoneMatch 如果指定的ETag和OSS文件的ETag不匹配,则正常传输文件,否则返回错误(304 Not modified)。 oss.IfNoneMatch
func (*CommonAliyunOss) RangeDownload ¶
func (c *CommonAliyunOss) RangeDownload(objectKeyName string, start, end int64) ([]byte, error)
func (*CommonAliyunOss) RangeDownloadFromBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) RangeDownloadFromBucket(bucketName, objectKeyName string, start, end int64) ([]byte, error)
仅需要文件中的部分数据,您可以使用范围下载
func (*CommonAliyunOss) StreamDownload ¶
func (c *CommonAliyunOss) StreamDownload(objectKeyName string) ([]byte, error)
func (*CommonAliyunOss) StreamDownloadFromBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) StreamDownloadFromBucket(bucketName, objectKeyName string) ([]byte, error)
流下载
func (*CommonAliyunOss) UploadString ¶
func (c *CommonAliyunOss) UploadString(objectKeyName, objectValue string) error
func (*CommonAliyunOss) UploadStringToBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) UploadStringToBucket(bucketName, objectKeyName, objectValue string) error
上传普通数据
func (*CommonAliyunOss) Uploadfile ¶
func (c *CommonAliyunOss) Uploadfile(objectKeyName, localFilePath string) error
func (*CommonAliyunOss) UploadfileToBucket ¶ added in v1.2.3
func (c *CommonAliyunOss) UploadfileToBucket(bucketName, objectKeyName, localFilePath string) error
上传普通文件
type Config ¶
type Config struct { AccessKeyId string // DefaultBucket string // 存储库名 AccessKeySecret string // 开发者AccessKeySecret Endpoint string // 机房节点 ConnTimeout int // 请求超时时间,包括连接超时、Socket读写超时,单位秒,默认连接超时30秒,读写超时60秒 RWTimeout int // 读写超时设置 EnableMD5 bool // 是否开启MD5校验。推荐使用CRC校验,CRC的效率高于MD5 EnableCRC bool // 是否开启CRC校验 UseCname bool // 是否使用自定义域名CNAME AuthProxy string // 带账号密码的代理服务器 Proxy string // 代理服务器,如http://8.8.8.8:3128 SecurityToken string // 临时用户的SecurityToken }
func DefaultConfig ¶
func DefaultConfig() *Config
type MultipartOss ¶
type MultipartOss struct {
// contains filtered or unexported fields
}
func (*MultipartOss) CancelMultipartUpload ¶
func (mp *MultipartOss) CancelMultipartUpload(objectKeyName string) error
func (*MultipartOss) CancelMultipartUploadToBucket ¶ added in v1.2.3
func (mp *MultipartOss) CancelMultipartUploadToBucket(bucketName, objectKeyName string) error
取消分片上传
func (*MultipartOss) MultipartUpload ¶
func (mp *MultipartOss) MultipartUpload(objectKeyName, localFilePath string) (*aliOss.CompleteMultipartUploadResult, error)
func (*MultipartOss) MultipartUploadToBucket ¶ added in v1.2.3
func (mp *MultipartOss) MultipartUploadToBucket(bucketName, objectKeyName, localFilePath string) (*aliOss.CompleteMultipartUploadResult, error)
type ProgressOss ¶
type ProgressOss struct {
// contains filtered or unexported fields
}
func (*ProgressOss) ProgressDownload ¶
func (p *ProgressOss) ProgressDownload(objectKeyName, dstFilePath string) error
func (*ProgressOss) ProgressDownloadFromBucket ¶ added in v1.2.3
func (p *ProgressOss) ProgressDownloadFromBucket(bucketName, objectKeyName, dstFilePath string) error
下载使用进度条
func (*ProgressOss) ProgressUpload ¶
func (p *ProgressOss) ProgressUpload(objectKeyName, localFilePath string) error
func (*ProgressOss) ProgressUploadToBucket ¶ added in v1.2.3
func (p *ProgressOss) ProgressUploadToBucket(bucketName, objectKeyName, localFilePath string) error
上传使用进度条
Click to show internal directories.
Click to hide internal directories.