zus

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFs

func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error)

NewFs constructs an Fs from the path

Types

type Fs

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

func (*Fs) Copy added in v1.0.2

func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error)

Copy implements the fs.Fs Copy interface method. It performs a server-side copy of the source object to the specified destination path.

Parameters:

  • ctx: context for the operation (used for cancellation/deadlines)
  • src: the source fs.Object to be copied (must be of type *Object)
  • remote: the target relative path within the destination backend

Returns:

  • a new fs.Object representing the copied file
  • an error if the operation fails

func (*Fs) Equal added in v1.0.2

func (f *Fs) Equal(fs2 fs.Fs) bool

func (*Fs) Features

func (f *Fs) Features() *fs.Features

Features returns the optional features of thxis Fs

func (*Fs) Hashes

func (f *Fs) Hashes() hash.Set

Hashes are not exposed anywhere

func (*Fs) List

func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error)

List the objects and directories in dir into entries. The entries can be returned in any order but should be for a complete directory.

dir should be "" to list the root, and should not have trailing slashes.

This should return ErrDirNotFound if the directory isn't found.

func (*Fs) Mkdir

func (f *Fs) Mkdir(ctx context.Context, dir string) (err error)

Mkdir creates the directory if it doesn't exist

func (*Fs) Move added in v1.0.2

func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error)

Move moves a file from one location to another within the same remote.

It constructs an SDK move operation, optionally batching it if the batcher is enabled. Returns a new object pointing to the destination if the move is successful. Move performs move operation using FileOpertaionMove of GoSDK: A metadata-only move, using blobber-native logic

func (*Fs) Name

func (f *Fs) Name() string

Name of the remote (as passed into NewFs)

func (*Fs) NewObject

func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error)

NewObject finds the Object at remote. If it can't be found it returns the error fs.ErrorObjectNotFound.

func (*Fs) Precision

func (f *Fs) Precision() time.Duration

Precision of the ModTimes in this Fs

func (*Fs) Purge

func (f *Fs) Purge(ctx context.Context, dir string) error

Purge deletes all the files and the container

Optional interface: Only implement this if you have a way of deleting all the files quicker than just running Remove() on the result of List()

func (*Fs) Put

func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)

Put the object

Copy the reader in to the new object which is returned.

The new object may have been created if an error is returned

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

func (*Fs) Rmdir

func (f *Fs) Rmdir(ctx context.Context, dir string) (err error)

Rmdir deletes the given folder

Returns an error if it isn't empty

func (*Fs) Root

func (f *Fs) Root() string

Root of the remote (as passed into NewFs)

func (*Fs) String

func (f *Fs) String() string

String returns a description of the FS

type Object

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

func (*Object) Fs

func (o *Object) Fs() fs.Info

Fs returns read only access to the Fs that this object is part of

func (*Object) Hash

func (o *Object) Hash(ctx context.Context, t hash.Type) (_ string, err error)

Hash returns the selected checksum of the file If no checksum is available it returns ""

func (*Object) ModTime

func (o *Object) ModTime(ctx context.Context) time.Time

ModTime returns the modification date of the file It should return a best guess if one isn't available

func (*Object) Open

func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error)

Open an object for read

func (*Object) Remote

func (o *Object) Remote() string

Remote returns the object’s path relative to the backend’s configured root.

This is used by rclone to show the object's name/path from the user's perspective rather than the full internal absolute path.

func (*Object) Remove

func (o *Object) Remove(ctx context.Context) (err error)

Remove an object

func (*Object) SetModTime

func (o *Object) SetModTime(ctx context.Context, t time.Time) (err error)

SetModTime sets the metadata on the object to set the modification date

func (*Object) Size

func (o *Object) Size() int64

Size returns the size of the file

func (*Object) Storable

func (o *Object) Storable() bool

Storable says whether this object can be stored

func (*Object) String

func (o *Object) String() string

String returns a description of the Object

func (*Object) Update

func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error)

Update the object with the contents of the io.Reader, modTime and size

If existing is set then it updates the object rather than creating a new one.

The new object may have been created if an error is returned.

type Options

type Options struct {
	AllocationID string        `config:"allocation_id"`
	ConfigDir    string        `config:"config_dir"`
	Encrypt      bool          `config:"encrypt"`
	WorkDir      string        `config:"work_dir"`
	SdkLogLevel  int           `config:"sdk_log_level"`
	BatchMode    string        `config:"batch_mode"`
	BatchTimeout time.Duration `config:"batch_timeout"`
	BatchSize    int           `config:"batch_size"`
}

type ReaderBytes

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

func (*ReaderBytes) Read

func (r *ReaderBytes) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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