Documentation
¶
Index ¶
- Constants
- Variables
- func Lock(key string)
- func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs, error)
- func ToBmpReader(in io.Reader, realDataSize int64) (io.Reader, int64, int64)
- func Unlock(key string)
- type ChunkFileInfo
- type Fs
- func (f *Fs) About(ctx context.Context) (*fs.Usage, error)
- func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error)
- func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error
- func (f Fs) Features() *fs.Features
- func (f Fs) Hashes() hash.Set
- func (f Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error)
- func (f Fs) Mkdir(ctx context.Context, dir string) error
- func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error)
- func (f Fs) Name() string
- func (f Fs) NewObject(ctx context.Context, remote string) (fs.Object, error)
- func (f Fs) Precision() time.Duration
- func (f *Fs) Purge(ctx context.Context, dir string) error
- func (f Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f Fs) Rmdir(ctx context.Context, dir string) error
- func (f Fs) Root() string
- func (f Fs) String() string
- type Object
- func (o Object) Fs() fs.Info
- func (o Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error)
- func (o Object) Remote() string
- func (o Object) Remove(ctx context.Context) (err error)
- func (o Object) Size() int64
- func (o Object) String() string
- func (o Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
- type ObjectInfoWrapper
- type Options
Constants ¶
const ( MaxSliceSize = 1024 * 1024 * 29 CanUseSliceSize = 30408704 )
Variables ¶
var BmpHead = []byte{66, 77, 66, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
BmpHead 定义了位图的头部
Functions ¶
Types ¶
type ChunkFileInfo ¶
type ChunkFileInfo struct { Name string `json:"name"` FileSize int64 `json:"fileSize"` List []*fs.FileFragInfo `json:"list"` }
type Fs ¶
type Fs struct { FileStructure fs.Fs FileStore fs.Fs ChunkInfoCache *patrickmnCache.Cache // contains filtered or unexported fields }
Fs represents a wrapped fs.Fs
func (*Fs) Copy ¶
Copy src to this remote using server-side copy operations.
This is stored with the remote path given.
It returns the destination Object and a possible error.
Will only be called if src.Fs().Name() == f.Name()
If it isn't possible then return fs.ErrorCantCopy
type Object ¶
Object represents a composite file wrapping one or more data chunks
func (Object) Open ¶
func (o Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error)
Open opens the file for read. Call Close() on the returned io.ReadCloser
func (Object) Update ¶
func (o Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
Update in to the object with the modTime given of the given size
When called from outside an Fs by rclone, src.Size() will always be >= 0. But for unknown-sized objects (indicated by src.Size() == -1), Upload should either return an error or update the object properly (rather than e.g. calling panic).
type ObjectInfoWrapper ¶
type ObjectInfoWrapper struct { fs.ObjectInfo // contains filtered or unexported fields }
func NewObjectInfoWrapper ¶
func NewObjectInfoWrapper(objectInfo fs.ObjectInfo, remote string, size int64) *ObjectInfoWrapper
func (ObjectInfoWrapper) Remote ¶
func (ow ObjectInfoWrapper) Remote() string
func (ObjectInfoWrapper) Size ¶
func (ow ObjectInfoWrapper) Size() int64
Size returns the size of the file