Documentation ¶
Index ¶
- Variables
- func NewGcsFS(ctx context.Context, opts ...option.ClientOption) (afero.Fs, error)
- func NewGcsFSFromClient(ctx context.Context, client *storage.Client) (afero.Fs, error)
- func NewGcsFSFromClientWithSeparator(ctx context.Context, client *storage.Client, folderSeparator string) (afero.Fs, error)
- func NewGcsFSWithSeparator(ctx context.Context, folderSeparator string, opts ...option.ClientOption) (afero.Fs, error)
- type ByName
- type FileInfo
- type Fs
- func (fs *Fs) Chmod(_ string, _ os.FileMode) error
- func (fs *Fs) Chown(_ string, _, _ int) error
- func (fs *Fs) Chtimes(_ string, _, _ time.Time) error
- func (fs *Fs) Create(name string) (*GcsFile, error)
- func (fs *Fs) Mkdir(name string, _ os.FileMode) error
- func (fs *Fs) MkdirAll(path string, perm os.FileMode) error
- func (fs *Fs) Name() string
- func (fs *Fs) Open(name string) (*GcsFile, error)
- func (fs *Fs) OpenFile(name string, flag int, fileMode os.FileMode) (*GcsFile, error)
- func (fs *Fs) Remove(name string) error
- func (fs *Fs) RemoveAll(path string) error
- func (fs *Fs) Rename(oldName, newName string) error
- func (fs *Fs) Stat(name string) (os.FileInfo, error)
- type GcsFile
- func (o *GcsFile) Close() error
- func (o *GcsFile) Name() string
- func (o *GcsFile) Read(p []byte) (n int, err error)
- func (o *GcsFile) ReadAt(p []byte, off int64) (n int, err error)
- func (o *GcsFile) Readdir(count int) ([]os.FileInfo, error)
- func (o *GcsFile) Readdirnames(n int) ([]string, error)
- func (o *GcsFile) Seek(newOffset int64, whence int) (int64, error)
- func (o *GcsFile) Stat() (os.FileInfo, error)
- func (o *GcsFile) Sync() error
- func (o *GcsFile) Truncate(wantedSize int64) error
- func (o *GcsFile) Write(p []byte) (n int, err error)
- func (o *GcsFile) WriteAt(b []byte, off int64) (n int, err error)
- func (o *GcsFile) WriteString(s string) (ret int, err error)
- type GcsFs
- func (fs *GcsFs) Chmod(name string, mode os.FileMode) error
- func (fs *GcsFs) Chown(name string, uid, gid int) error
- func (fs *GcsFs) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (fs *GcsFs) Create(name string) (afero.File, error)
- func (fs *GcsFs) Mkdir(name string, perm os.FileMode) error
- func (fs *GcsFs) MkdirAll(path string, perm os.FileMode) error
- func (fs *GcsFs) Name() string
- func (fs *GcsFs) Open(name string) (afero.File, error)
- func (fs *GcsFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (fs *GcsFs) Remove(name string) error
- func (fs *GcsFs) RemoveAll(path string) error
- func (fs *GcsFs) Rename(oldname, newname string) error
- func (fs *GcsFs) Stat(name string) (os.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoBucketInName = errors.New("no bucket name found in the name") ErrFileClosed = errors.New("file is closed") ErrOutOfRange = errors.New("out of range") ErrObjectDoesNotExist = errors.New("storage: object doesn't exist") ErrEmptyObjectName = errors.New("storage: object name is empty") ErrFileNotFound = syscall.ENOENT )
Functions ¶
func NewGcsFS ¶
NewGcsFS creates a GCS file system, automatically instantiating and decorating the storage client. You can provide additional options to be passed to the client creation, as per cloud.google.com/go/storage documentation
func NewGcsFSFromClient ¶
NewGcsFSFromClient creates a GCS file system from a given storage client
func NewGcsFSFromClientWithSeparator ¶
func NewGcsFSFromClientWithSeparator(ctx context.Context, client *storage.Client, folderSeparator string) (afero.Fs, error)
NewGcsFSFromClientWithSeparator is the same as NewGcsFSFromClient, but the file system will use the provided folder separator.
func NewGcsFSWithSeparator ¶
func NewGcsFSWithSeparator(ctx context.Context, folderSeparator string, opts ...option.ClientOption) (afero.Fs, error)
NewGcsFSWithSeparator is the same as NewGcsFS, but the files system will use the provided folder separator.
Types ¶
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs is a Fs implementation that uses functions provided by google cloud storage
func NewGcsFsWithSeparator ¶
type GcsFile ¶
type GcsFile struct { ReadDirIt stiface.ObjectIterator // contains filtered or unexported fields }
GcsFs is the Afero version adapted for GCS
func NewGcsFile ¶
func NewGcsFileFromOldFH ¶
Click to show internal directories.
Click to hide internal directories.