qiniu

package
v0.0.0-...-c32de3e Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBucketNoEmpty          = errors.New("bucket name does not empty")
	ErrNotSupportedFileAppend = errors.New("file append is not supported")
	ErrNotSupportedCreateDir  = errors.New("creating a directory is not supported")
)

Functions

This section is empty.

Types

type QiniuFileInfo

type QiniuFileInfo struct {
	// contains filtered or unexported fields
}

七牛文件信息

func NewQiniuFileInfo

func NewQiniuFileInfo(info storage.FileInfo) *QiniuFileInfo

func (*QiniuFileInfo) Hash

func (f *QiniuFileInfo) Hash() string

func (*QiniuFileInfo) IsDir

func (f *QiniuFileInfo) IsDir() bool

func (*QiniuFileInfo) MimeType

func (f *QiniuFileInfo) MimeType() string

func (*QiniuFileInfo) ModTime

func (f *QiniuFileInfo) ModTime() time.Time

func (*QiniuFileInfo) Name

func (f *QiniuFileInfo) Name() string

func (*QiniuFileInfo) Size

func (f *QiniuFileInfo) Size() int64

func (*QiniuFileInfo) Sys

func (f *QiniuFileInfo) Sys() interface{}

type QiniuStorage

type QiniuStorage struct {
	// contains filtered or unexported fields
}

func NewQiniuStorage

func NewQiniuStorage(accessKey string, secretKey string, ctx storage.Context) *QiniuStorage

func (*QiniuStorage) Append

func (s *QiniuStorage) Append(path string, contents string, context storage.Context) (int64, error)

func (*QiniuStorage) AppendBytes

func (s *QiniuStorage) AppendBytes(path string, contents []byte, context storage.Context) (int64, error)

func (*QiniuStorage) AppendStream

func (s *QiniuStorage) AppendStream(path string, reader io.Reader, context storage.Context) (int64, error)

func (*QiniuStorage) Copy

func (s *QiniuStorage) Copy(src string, dst string, context storage.Context) error

复制文件

func (*QiniuStorage) CreateDir

func (s *QiniuStorage) CreateDir(dst string, context storage.Context) error

func (*QiniuStorage) Delete

func (s *QiniuStorage) Delete(dst string, context storage.Context) error

删除文件

func (*QiniuStorage) DeleteDir

func (s *QiniuStorage) DeleteDir(dst string, context storage.Context) error

删除目录,目前实现的是删除指定前缀的文件

func (*QiniuStorage) ListDir

func (s *QiniuStorage) ListDir(dst string, ctx storage.Context) ([]storage.FileInfo, int64, error)

列出指定前缀的文件

func (*QiniuStorage) ReName

func (s *QiniuStorage) ReName(path string, newPath string, context storage.Context) error

重命名文件

func (*QiniuStorage) Stat

func (s *QiniuStorage) Stat(path string, context storage.Context) (storage.FileInfo, error)

获取文件信息

func (*QiniuStorage) Write

func (s *QiniuStorage) Write(path string, contents string, context storage.Context) (int64, error)

写入文件

func (*QiniuStorage) WriteBytes

func (s *QiniuStorage) WriteBytes(path string, contents []byte, context storage.Context) (int64, error)

以字节的方式写入到七牛云储存

func (*QiniuStorage) WriteStream

func (s *QiniuStorage) WriteStream(path string, reader io.Reader, size int64, context storage.Context) error

以流的方式写入到七牛云储存中

Jump to

Keyboard shortcuts

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