koofr

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFs

func NewFs(name, root string, m configmap.Mapper) (ff fs.Fs, err error)

NewFs constructs a new filesystem given a root path and configuration options

Types

type Fs

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

A Fs is a representation of a remote Koofr Fs

func (*Fs) About

func (f *Fs) About() (*fs.Usage, error)

About reports space usage (with a MB precision)

func (*Fs) Copy

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

Copy copies a remote Object to the given path

func (*Fs) DirMove

func (f *Fs) DirMove(src fs.Fs, srcRemote, dstRemote string) error

DirMove moves a remote directory to the given path

func (*Fs) Features

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

Features returns the optional features supported by this Fs

func (*Fs) Hashes

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

Hashes returns a set of hashes are Provided by the Fs

func (*Fs) List

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

List returns a list of items in a directory

func (*Fs) Mkdir

func (f *Fs) Mkdir(dir string) error

Mkdir creates a directory at the given remote path. Creates ancestors if necessary

func (*Fs) Move

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

Move moves a remote Object to the given path

func (*Fs) Name

func (f *Fs) Name() string

Name returns the name of the Fs

func (*Fs) NewObject

func (f *Fs) NewObject(remote string) (obj fs.Object, err error)

NewObject creates a new remote Object for a given remote path

func (*Fs) Precision

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

Precision denotes that setting modification times is not supported

func (f *Fs) PublicLink(remote string) (string, error)

PublicLink creates a public link to the remote path

func (*Fs) Purge

func (f *Fs) Purge() error

Purge purges the complete Fs

func (*Fs) Put

func (f *Fs) Put(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (obj fs.Object, err error)

Put updates a remote Object

func (*Fs) PutStream

func (f *Fs) PutStream(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)

PutStream updates a remote Object with a stream of unknown size

func (*Fs) Rmdir

func (f *Fs) Rmdir(dir string) error

Rmdir removes an (empty) directory at the given remote path

func (*Fs) Root

func (f *Fs) Root() string

Root returns the root path of the Fs

func (*Fs) String

func (f *Fs) String() string

String returns a string representation of the Fs

type Object

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

An Object on the remote Koofr Fs

func (*Object) Fs

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

Fs returns a reference to the Koofr Fs containing the Object

func (*Object) Hash

func (o *Object) Hash(typ hash.Type) (string, error)

Hash returns an MD5 hash of the Object

func (*Object) ModTime

func (o *Object) ModTime() time.Time

ModTime returns the modification time of the Object

func (*Object) Open

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

Open opens the Object for reading

func (*Object) Remote

func (o *Object) Remote() string

Remote returns the remote path of the Object, relative to Fs root

func (*Object) Remove

func (o *Object) Remove() error

Remove deletes the remote Object

func (*Object) SetModTime

func (o *Object) SetModTime(mtime time.Time) error

SetModTime is not supported

func (*Object) Size

func (o *Object) Size() int64

Size return the size of the Object in bytes

func (*Object) Storable

func (o *Object) Storable() bool

Storable returns true if the Object is storable

func (*Object) String

func (o *Object) String() string

String returns a string representation of the remote Object

func (*Object) Update

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

Update updates the Object contents

type Options

type Options struct {
	Endpoint string `config:"endpoint"`
	MountID  string `config:"mountid"`
	User     string `config:"user"`
	Password string `config:"password"`
}

Options represent the configuration of the Koofr backend

Jump to

Keyboard shortcuts

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