Documentation
¶
Index ¶
- Constants
- func NewQiNiu(config *QiNiuConfiguration) contract.Storage
- type QiNiu
- func (q QiNiu) Bucket() *storage.BucketManager
- func (q QiNiu) Callback(req *http.Request) (*contract.StorageInfo, error)
- func (q QiNiu) FormUpload(ctx context.Context, metadata *contract.StorageMetadata) (*contract.StorageInfo, error)
- func (q QiNiu) PartUpload(ctx context.Context, metadata *contract.StorageMetadata, ...) (*contract.StorageInfo, error)
- func (q QiNiu) Token() string
- func (q QiNiu) Url(key string, params url2.Values) string
- type QiNiuConfiguration
- type ReturnResult
Constants ¶
View Source
const QiNiuDisk = `qiniu`
Variables ¶
This section is empty.
Functions ¶
Types ¶
type QiNiu ¶
type QiNiu struct {
// contains filtered or unexported fields
}
func (QiNiu) FormUpload ¶
func (q QiNiu) FormUpload(ctx context.Context, metadata *contract.StorageMetadata) (*contract.StorageInfo, error)
简单表单上传
func (QiNiu) PartUpload ¶
func (q QiNiu) PartUpload(ctx context.Context, metadata *contract.StorageMetadata, notify contract.Notify) (*contract.StorageInfo, error)
分块上传
type QiNiuConfiguration ¶
type QiNiuConfiguration struct { AccessKey string `json:"access_key" yaml:"access_key" mapstructure:"access_key"` SecretKey string `json:"secret_key" yaml:"secret_key" mapstructure:"secret_key"` Bucket string `json:"bucket" yaml:"bucket"` IsPrivate bool `json:"is_private" yaml:"is_private" mapstructure:"is_private"` Region string `json:"region" yaml:"region"` // z0:Huadong z1:Huabei z2:Huanan na0:NorthAmerica as0:Singapore Domain string `json:"domain" yaml:"domain"` Expires uint64 `json:"expires" yaml:"expires"` // 资源公开有效期,单位:s UseHttps bool `json:"use_https" yaml:"use_https" mapstructure:"use_https"` UseCdn bool `json:"use_cdn" yaml"use_cdn" mapstructure:"use_cdn"` NotifyUrl string `json:"notify_url" yaml:"notify_url" mapstructure:"notify_url"` }
type ReturnResult ¶
type ReturnResult struct { Hash string `json:"hash"` PersistentID string `json:"persistent_id"` Key string `json:"key"` OriginalName string `json:"original_name"` Ext string `json:"ext"` Bucket string `json:"bucket"` ImageInfo struct { Width int `json:"width"` Height int `json:"height"` } `json:"image_info"` Exif map[string]interface{} `json:"exif"` AvInfo map[string]interface{} `json:"avinfo"` MimeType string `json:"mime_type"` Size int `json:"size"` }
Click to show internal directories.
Click to hide internal directories.