Documentation ¶
Index ¶
- func CreateDefaultClient(config *Config)
- func NewStarter() *starter
- func XFClient(f func(c *QnClient) error) error
- type Config
- type ProgressRecord
- type QnClient
- func (client *QnClient) BreakPointUpload(fileKey, localFilePath, recordDir string) (storage.PutRet, error)
- func (client *QnClient) BreakPointUploadToBucket(bucket, fileKey, localFilePath, recordDir string) (storage.PutRet, error)
- func (client *QnClient) CallbackUpload() (upToken string)
- func (client *QnClient) CallbackUploadToBucket(bucket string) (upToken string)
- func (client *QnClient) FormUploadWithByteSlice(fileKey string, data []byte) (storage.PutRet, error)
- func (client *QnClient) FormUploadWithByteSliceToBucket(bucket, fileKey string, data []byte) (storage.PutRet, error)
- func (client *QnClient) FormUploadWithLocalFile(fileKey, localFilePath string) (storage.PutRet, error)
- func (client *QnClient) FormUploadWithLocalFileToBucket(bucket, fileKey, localFilePath string) (storage.PutRet, error)
- func (client *QnClient) MultipartUpload(fileKey, localFilePath string) (storage.PutRet, error)
- func (client *QnClient) MultipartUploadToBucket(bucket, fileKey, localFilePath string) (storage.PutRet, error)
- func (client *QnClient) OverwriteUpload(keyToOverwrite string) (upToken string)
- func (client *QnClient) OverwriteUploadToBucket(bucket, keyToOverwrite string) (upToken string)
- func (client *QnClient) SimpleUpload() (upToken string)
- func (client *QnClient) SimpleUploadToBucket(bucket string) (upToken string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStarter ¶
func NewStarter() *starter
Types ¶
type Config ¶
type Config struct { AccessKey string // 开发者key SecretKey string // 开发者secret DefaultBucket string // 存储库名 ReturnBody string // 返回信息格式 UseHTTPS bool // 是否使用https域名 UseCdnDomains bool // 上传是否使用CDN上传加速 UpTokenExpires int // 上传凭证有效期 CallbackURL string // 上传回调地址 CallbackBody string // 上传回调信息格式 CallbackBodyType string // 上传回调信息格式 EndUser string // 唯一宿主标识 FsizeMin int // 限定上传文件大小最小值,单位Byte。 FsizeMax int // 限定上传文件大小最大值,单位Byte。超过限制上传文件大小的最大值会被判为上传失败,返回 413 状态码。 MimeLimit string // 限定上传类型 }
func DefaultConfig ¶
func DefaultConfig() *Config
type ProgressRecord ¶
type QnClient ¶
type QnClient struct {
// contains filtered or unexported fields
}
func NewQnClient ¶
func (*QnClient) BreakPointUpload ¶
func (*QnClient) BreakPointUploadToBucket ¶ added in v1.2.3
func (client *QnClient) BreakPointUploadToBucket(bucket, fileKey, localFilePath, recordDir string) (storage.PutRet, error)
@param bucket string 指定上传的bucket @param fileKey string 文件唯一key @param localFilePath string 本地文件路径 @param recordKey string 指定的进度文件保存目录,实际情况下,请确保该目录存在,而且只用于记录进度文件
func (*QnClient) CallbackUpload ¶
默认bucket带回调上传,返回上传凭证,给客户端上传
func (*QnClient) CallbackUploadToBucket ¶ added in v1.2.3
带回调上传,返回上传凭证,给客户端上传
func (*QnClient) FormUploadWithByteSlice ¶
func (*QnClient) FormUploadWithByteSliceToBucket ¶ added in v1.2.3
func (client *QnClient) FormUploadWithByteSliceToBucket(bucket, fileKey string, data []byte) (storage.PutRet, error)
字节数组上传
func (*QnClient) FormUploadWithLocalFile ¶
func (*QnClient) FormUploadWithLocalFileToBucket ¶ added in v1.2.3
func (client *QnClient) FormUploadWithLocalFileToBucket(bucket, fileKey, localFilePath string) (storage.PutRet, error)
表单上传 @param bucket string 指定上传的bucket @param fileKey string 文件唯一key @param localFilePath string 本地文件路径
func (*QnClient) MultipartUpload ¶
func (*QnClient) MultipartUploadToBucket ¶ added in v1.2.3
func (client *QnClient) MultipartUploadToBucket(bucket, fileKey, localFilePath string) (storage.PutRet, error)
分块上传 @param bucket string 指定上传的bucket @param fileKey string 文件唯一key @param localFilePath string 本地文件路径
func (*QnClient) OverwriteUpload ¶
默认bucket覆盖上传,返回上传凭证,给客户端上传
func (*QnClient) OverwriteUploadToBucket ¶ added in v1.2.3
覆盖上传,返回上传凭证,给客户端上传
func (*QnClient) SimpleUpload ¶
默认bucket简单上传,返回上传凭证,给客户端上传
func (*QnClient) SimpleUploadToBucket ¶ added in v1.2.3
简单上传,返回上传凭证给客户端上传
Click to show internal directories.
Click to hide internal directories.