qiniu

package
v0.0.0-...-c605425 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectUploader

type DirectUploader struct {
	Bucket        string
	FileServer    string
	Zone          *storage.Zone
	UseHTTPS      bool
	UseCdnDomains bool
	Expires       uint32
}

func NewUploader

func NewUploader(bucket string, fileServer string, zone *storage.Zone, useHttps bool,
	useCdnDomains bool, expires uint32) DirectUploader

func NewUploaderDefault

func NewUploaderDefault() DirectUploader

default config default config

func (*DirectUploader) BatchFileInfo

func (d *DirectUploader) BatchFileInfo(keys []string) []storage.BatchOpRet

func (*DirectUploader) BucketManager

func (d *DirectUploader) BucketManager() *storage.BucketManager

func (*DirectUploader) ByteUpload

func (d *DirectUploader) ByteUpload(data []byte, fileName string) (url string, key string, err error)

上传bytes

func (*DirectUploader) ChangeMimeType

func (d *DirectUploader) ChangeMimeType(key string, mimeType string) error

ChangeMime

func (*DirectUploader) DeleteFile

func (d *DirectUploader) DeleteFile(key string) error

删除文件

func (*DirectUploader) FileInfo

func (d *DirectUploader) FileInfo(key string) (storage.FileInfo, error)

获取文件信息

func (*DirectUploader) FilerUpload

func (d *DirectUploader) FilerUpload(file multipart.File, fileHeader *multipart.FileHeader) (url string, key string, err error)

FilerUpload: 文件直传方式

func (*DirectUploader) PrivateReadURL

func (d *DirectUploader) PrivateReadURL(key string) string

对于私有空间,首先需要按照公开空间的文件访问方式构建对应的公开空间访问链接,然后再对这个链接进行私有授权签名。

func (*DirectUploader) PublicReadUrl

func (d *DirectUploader) PublicReadUrl(key string) string

func (*DirectUploader) Upload

func (d *DirectUploader) Upload(file multipart.File, fileHeader *multipart.FileHeader) (string, string, error)

type IQiuNiuUploader

type IQiuNiuUploader interface {
	FilerUpload(file multipart.File, fileHeader *multipart.FileHeader) (url string, key string, err error)
	ByteUpload(bytes []byte, fileName string) (url string, key string, err error)
	PublicReadUrl(key string) string
	PrivateReadURL(key string) string
	FileInfo(key string) (storage.FileInfo, error)
	ChangeMimeType(key, mimeType string) error
	DeleteFile(key string) error
}

type MyPutRet

type MyPutRet struct {
	Key    string
	Hash   string
	Fsize  int
	Bucket string
	Name   string
}

自定义返回值结构体

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL