Documentation ¶
Overview ¶
Package upstream provides utility functionality to union.
Index ¶
- Variables
- func Prepare(fses []*Fs) error
- type Directory
- type Entry
- type Fs
- func (f *Fs) About(ctx context.Context) (*fs.Usage, error)
- func (f *Fs) GetFreeSpace() (int64, error)
- func (f *Fs) GetNumObjects() (int64, error)
- func (f *Fs) GetUsedSpace() (int64, error)
- func (f *Fs) IsCreatable() bool
- func (f *Fs) IsWritable() bool
- 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) WrapDirectory(e fs.Directory) *Directory
- func (f *Fs) WrapEntry(e fs.DirEntry) (Entry, error)
- func (f *Fs) WrapObject(o fs.Object) *Object
- type Object
- func (o *Object) GetTier() string
- func (o *Object) ID() string
- func (o *Object) Metadata(ctx context.Context) (fs.Metadata, error)
- func (o *Object) MimeType(ctx context.Context) (mimeType string)
- func (o *Object) SetTier(tier string) error
- func (o *Object) UnWrap() fs.Object
- func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
- func (o *Object) UpstreamFs() *Fs
- func (o *Object) Writeback(ctx context.Context) (*Object, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUsageFieldNotSupported stats the usage field is not supported by the backend ErrUsageFieldNotSupported = errors.New("this usage field is not supported") )
Functions ¶
Types ¶
type Directory ¶
Directory describes a wrapped Directory
This is a wrapped Directory which contains the upstream Fs
func (*Directory) UpstreamFs ¶
UpstreamFs get the upstream Fs the entry is stored in
type Fs ¶
type Fs struct { fs.Fs RootFs fs.Fs RootPath string Opt *common.Options // contains filtered or unexported fields }
Fs is a wrap of any fs and its configs
func (*Fs) GetFreeSpace ¶
GetFreeSpace get the free space of the fs
This is returned as 0..math.MaxInt64-1 leaving math.MaxInt64 as a sentinel
func (*Fs) GetNumObjects ¶
GetNumObjects get the number of objects of the fs
func (*Fs) GetUsedSpace ¶
GetUsedSpace get the used space of the fs
This is returned as 0..math.MaxInt64-1 leaving math.MaxInt64 as a sentinel
func (*Fs) IsCreatable ¶
IsCreatable return if the fs is allowed to create new objects
func (*Fs) IsWritable ¶
IsWritable return if the fs is allowed to write
func (*Fs) Put ¶
func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
Put in to the remote path with the modTime given of the given size
May create the object even if it returns an error - if so will return the object and the error, otherwise will return nil and the error
func (*Fs) PutStream ¶
func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
PutStream uploads to the remote path with the modTime given of indeterminate size
May create the object even if it returns an error - if so will return the object and the error, otherwise will return nil and the error
func (*Fs) WrapDirectory ¶
WrapDirectory wraps an fs.Directory to include the info of the upstream Fs
type Object ¶
Object describes a wrapped Object
This is a wrapped Object which contains the upstream Fs
func (*Object) Metadata ¶ added in v1.59.1
Metadata returns metadata for an object
It should return nil if there is no Metadata
func (*Object) SetTier ¶ added in v1.59.1
SetTier performs changing storage tier of the Object if multiple storage classes supported
func (*Object) UnWrap ¶
UnWrap returns the Object that this Object is wrapping or nil if it isn't wrapping anything
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).
func (*Object) UpstreamFs ¶
UpstreamFs get the upstream Fs the entry is stored in