Documentation ¶
Overview ¶
Google Cloud Storage interface
Index ¶
- func NewFs(name, root string) (fs.Fs, error)
- type FsObjectStorage
- func (o *FsObjectStorage) Fs() fs.Fs
- func (o *FsObjectStorage) Md5sum() (string, error)
- func (o *FsObjectStorage) ModTime() time.Time
- func (o *FsObjectStorage) Open() (in io.ReadCloser, err error)
- func (o *FsObjectStorage) Remote() string
- func (o *FsObjectStorage) Remove() error
- func (o *FsObjectStorage) SetModTime(modTime time.Time)
- func (o *FsObjectStorage) Size() int64
- func (o *FsObjectStorage) Storable() bool
- func (o *FsObjectStorage) String() string
- func (o *FsObjectStorage) Update(in io.Reader, modTime time.Time, size int64) error
- type FsStorage
- func (f *FsStorage) Copy(src fs.Object, remote string) (fs.Object, error)
- func (f *FsStorage) List() fs.ObjectsChan
- func (f *FsStorage) ListDir() fs.DirChan
- func (f *FsStorage) Mkdir() error
- func (f *FsStorage) Name() string
- func (f *FsStorage) NewFsObject(remote string) fs.Object
- func (fs *FsStorage) Precision() time.Duration
- func (f *FsStorage) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error)
- func (f *FsStorage) Rmdir() error
- func (f *FsStorage) Root() string
- func (f *FsStorage) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FsObjectStorage ¶
type FsObjectStorage struct {
// contains filtered or unexported fields
}
FsObjectStorage describes a storage object
Will definitely have info but maybe not meta
func (*FsObjectStorage) Md5sum ¶
func (o *FsObjectStorage) Md5sum() (string, error)
Md5sum returns the Md5sum of an object returning a lowercase hex string
func (*FsObjectStorage) ModTime ¶
func (o *FsObjectStorage) ModTime() time.Time
ModTime returns the modification time of the object
It attempts to read the objects mtime and if that isn't present the LastModified returned in the http headers
func (*FsObjectStorage) Open ¶
func (o *FsObjectStorage) Open() (in io.ReadCloser, err error)
Open an object for read
func (*FsObjectStorage) SetModTime ¶
func (o *FsObjectStorage) SetModTime(modTime time.Time)
Sets the modification time of the local fs object
func (*FsObjectStorage) Size ¶
func (o *FsObjectStorage) Size() int64
Size returns the size of an object in bytes
func (*FsObjectStorage) Storable ¶
func (o *FsObjectStorage) Storable() bool
Is this object storable
type FsStorage ¶
type FsStorage struct {
// contains filtered or unexported fields
}
FsStorage represents a remote storage server
func (*FsStorage) 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
func (*FsStorage) List ¶
func (f *FsStorage) List() fs.ObjectsChan
Walk the path returning a channel of FsObjects
func (*FsStorage) Put ¶
func (f *FsStorage) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error)
Put the object into the bucket
Copy the reader in to the new object which is returned ¶
The new object may have been created if an error is returned
func (*FsStorage) Rmdir ¶
Rmdir deletes the bucket
Returns an error if it isn't empty: Error 409: The bucket you tried to delete was not empty.