Documentation ¶
Index ¶
- Constants
- func WithProgressListenerDist(dist string) listenerOpt
- func WithProgressListenerSrc(src string) listenerOpt
- func WithProgressOp(op Op) listenerOpt
- type Client
- type DirEntry
- func (d DirEntry) Dir() string
- func (d DirEntry) ETag() string
- func (d DirEntry) Info() (fs.FileInfo, error)
- func (d DirEntry) IsDir() bool
- func (d DirEntry) Name() string
- func (d DirEntry) Path() string
- func (d *DirEntry) SetETag(etag string)
- func (d *DirEntry) SetInfo(info *FileInfo)
- func (d *DirEntry) SetModTime(t time.Time)
- func (d *DirEntry) SetPath(path string)
- func (d *DirEntry) SetSize(size int64)
- func (d DirEntry) Type() fs.FileMode
- type FS
- func (f *FS) Close()
- func (f *FS) Copy(ctx context.Context, src string, dist string) error
- func (f *FS) Download(ctx context.Context, remotePath string, localPath string) error
- func (f *FS) Events() <-chan ProgressEvent
- func (f *FS) Exists(ctx context.Context, key string, etag string) bool
- func (f *FS) Open(ctx context.Context, name string) (fs.File, error)
- func (f *FS) OpenWithEtag(ctx context.Context, name string, etag string) (fs.File, error)
- func (f *FS) PathAddPrefix(name string) string
- func (f *FS) PathRemovePrefix(name string) string
- func (f *FS) ReadAt(ctx context.Context, name string, size int64, offset int64) ([]byte, error)
- func (fs *FS) ReadDirFile(name string) *ReadDirFile
- func (f *FS) ReadFile(ctx context.Context, name string) ([]byte, error)
- func (f *FS) RemotePathFromLocalFile(localFile *local.FileInfo) (string, error)
- func (f *FS) Remove(ctx context.Context, keys ...string) ([]string, error)
- func (f *FS) RemoveAll(ctx context.Context, dir string) ([]string, error)
- func (f *FS) Rename(ctx context.Context, src string, dist string) error
- func (f *FS) RenameDir(ctx context.Context, src string, dist string) error
- func (f *FS) Root() string
- func (f *FS) RootEntry() *DirEntry
- func (f *FS) Stat(ctx context.Context, name string) (fs.FileInfo, error)
- func (f *FS) Upload(ctx context.Context, key string, r io.Reader) error
- func (f *FS) UploadFile(ctx context.Context, localFile *local.FileInfo) error
- type File
- type FileInfo
- func (fi FileInfo) Dir() string
- func (fi FileInfo) ETag() string
- func (fi FileInfo) IsDir() bool
- func (fi FileInfo) ModTime() time.Time
- func (fi FileInfo) Mode() os.FileMode
- func (fi FileInfo) Name() string
- func (fi FileInfo) Path() string
- func (fi *FileInfo) SetETag(etag string)
- func (fi *FileInfo) SetModTime(t time.Time)
- func (fi *FileInfo) SetPath(path string)
- func (fi *FileInfo) SetSize(size int64)
- func (fi FileInfo) Size() int64
- func (fi FileInfo) String() string
- func (fi FileInfo) Sys() any
- type MultiProgressListener
- func (listener *MultiProgressListener) Close()
- func (listener *MultiProgressListener) CopyListener(src string, dist string) oss.ProgressListener
- func (listener *MultiProgressListener) DownloadListener(remote string, local string) oss.ProgressListener
- func (listener *MultiProgressListener) Events() <-chan ProgressEvent
- func (listener *MultiProgressListener) RemoveListener(src string) oss.ProgressListener
- func (listener *MultiProgressListener) UploadListener(local string, remote string) oss.ProgressListener
- type Op
- type Option
- type ProgressEvent
- type ProgressListener
- type ReadDirFS
- type ReadDirFile
Constants ¶
View Source
const ( MaxKeys = 1000 MinBigFile = 500 << 20 MaxParts = 10000 MinParts = 1000 DefaultPartSize = 500 << 10 )
Variables ¶
This section is empty.
Functions ¶
func WithProgressListenerDist ¶
func WithProgressListenerDist(dist string) listenerOpt
func WithProgressListenerSrc ¶
func WithProgressListenerSrc(src string) listenerOpt
func WithProgressOp ¶
func WithProgressOp(op Op) listenerOpt
Types ¶
type DirEntry ¶
type DirEntry struct {
// contains filtered or unexported fields
}
DirEntry implements fs.DirEntry.
func NewDirEntry ¶
func (*DirEntry) SetModTime ¶ added in v1.0.5
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func (*FS) Events ¶
func (f *FS) Events() <-chan ProgressEvent
func (*FS) OpenWithEtag ¶ added in v1.0.5
func (*FS) PathAddPrefix ¶ added in v1.0.4
func (*FS) PathRemovePrefix ¶ added in v1.0.4
func (*FS) ReadDirFile ¶ added in v1.0.4
func (fs *FS) ReadDirFile(name string) *ReadDirFile
func (*FS) RemotePathFromLocalFile ¶
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
func NewFileInfo ¶
func NewFileInfo(obj *oss.ObjectProperties) *FileInfo
func NewFileInfoWithDir ¶
func (*FileInfo) SetModTime ¶ added in v1.0.5
type MultiProgressListener ¶
type MultiProgressListener struct {
// contains filtered or unexported fields
}
func NewMultiProgressListener ¶
func NewMultiProgressListener() *MultiProgressListener
func (*MultiProgressListener) Close ¶
func (listener *MultiProgressListener) Close()
func (*MultiProgressListener) CopyListener ¶
func (listener *MultiProgressListener) CopyListener(src string, dist string) oss.ProgressListener
func (*MultiProgressListener) DownloadListener ¶
func (listener *MultiProgressListener) DownloadListener(remote string, local string) oss.ProgressListener
func (*MultiProgressListener) Events ¶
func (listener *MultiProgressListener) Events() <-chan ProgressEvent
func (*MultiProgressListener) RemoveListener ¶
func (listener *MultiProgressListener) RemoveListener(src string) oss.ProgressListener
func (*MultiProgressListener) UploadListener ¶
func (listener *MultiProgressListener) UploadListener(local string, remote string) oss.ProgressListener
type ProgressEvent ¶
type ProgressEvent struct { Src string Dist string oss.ProgressEvent Op Op }
func (ProgressEvent) Progress ¶
func (e ProgressEvent) Progress() float64
func (ProgressEvent) Status ¶
func (e ProgressEvent) Status() string
func (ProgressEvent) String ¶
func (e ProgressEvent) String() string
type ProgressListener ¶
type ProgressListener struct {
// contains filtered or unexported fields
}
定义进度条监听器。
func NewProgressListener ¶
func NewProgressListener(ch chan<- ProgressEvent, opts ...listenerOpt) *ProgressListener
func (*ProgressListener) ProgressChanged ¶
func (listener *ProgressListener) ProgressChanged(event *oss.ProgressEvent)
定义进度变更事件处理函数。
type ReadDirFile ¶
type ReadDirFile struct { FS // contains filtered or unexported fields }
func NewReadDirFile ¶
func NewReadDirFile(fs *FS, name string) *ReadDirFile
func (*ReadDirFile) Completed ¶
func (f *ReadDirFile) Completed() bool
func (*ReadDirFile) Dir ¶ added in v1.0.4
func (f *ReadDirFile) Dir() string
func (*ReadDirFile) DirEntry ¶ added in v1.0.4
func (f *ReadDirFile) DirEntry() *DirEntry
func (*ReadDirFile) Reset ¶
func (f *ReadDirFile) Reset()
Click to show internal directories.
Click to hide internal directories.