package gcsfs

import "github.com/spf13/afero/gcsfs"

Index

Variables

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
)

Types

type ByName

type ByName []*FileInfo

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

func (ByName) Swap

func (a ByName) Swap(i, j int)

type FileInfo

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

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (fi *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (fi *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (fi *FileInfo) Name() string

func (*FileInfo) Size

func (fi *FileInfo) Size() int64

func (*FileInfo) Sys

func (fi *FileInfo) Sys() interface{}

type GcsFile

type GcsFile struct {
	ReadDirIt stiface.ObjectIterator
	// contains filtered or unexported fields
}

GcsFs is the Afero version adapted for GCS

func NewGcsFile

func NewGcsFile(
	ctx context.Context,
	fs *GcsFs,
	obj stiface.ObjectHandle,
	openFlags int,

	fileMode os.FileMode,
	name string,
) *GcsFile

func NewGcsFileFromOldFH

func NewGcsFileFromOldFH(
	openFlags int,
	fileMode os.FileMode,
	oldFile *gcsFileResource,
) *GcsFile

func (*GcsFile) Close

func (o *GcsFile) Close() error

func (*GcsFile) Name

func (o *GcsFile) Name() string

func (*GcsFile) Read

func (o *GcsFile) Read(p []byte) (n int, err error)

func (*GcsFile) ReadAt

func (o *GcsFile) ReadAt(p []byte, off int64) (n int, err error)

func (*GcsFile) Readdir

func (o *GcsFile) Readdir(count int) ([]os.FileInfo, error)

func (*GcsFile) Readdirnames

func (o *GcsFile) Readdirnames(n int) ([]string, error)

func (*GcsFile) Seek

func (o *GcsFile) Seek(newOffset int64, whence int) (int64, error)

func (*GcsFile) Stat

func (o *GcsFile) Stat() (os.FileInfo, error)

func (*GcsFile) Sync

func (o *GcsFile) Sync() error

func (*GcsFile) Truncate

func (o *GcsFile) Truncate(wantedSize int64) error

func (*GcsFile) Write

func (o *GcsFile) Write(p []byte) (n int, err error)

func (*GcsFile) WriteAt

func (o *GcsFile) WriteAt(b []byte, off int64) (n int, err error)

func (*GcsFile) WriteString

func (o *GcsFile) WriteString(s string) (ret int, err error)

type GcsFs

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

GcsFs is a Fs implementation that uses functions provided by google cloud storage

func NewGcsFs

func NewGcsFs(ctx context.Context, client stiface.Client) *GcsFs

func NewGcsFsWithSeparator

func NewGcsFsWithSeparator(ctx context.Context, client stiface.Client, folderSep string) *GcsFs

func (*GcsFs) Chmod

func (fs *GcsFs) Chmod(_ string, _ os.FileMode) error

func (*GcsFs) Chown

func (fs *GcsFs) Chown(_ string, _, _ int) error

func (*GcsFs) Chtimes

func (fs *GcsFs) Chtimes(_ string, _, _ time.Time) error

func (*GcsFs) Create

func (fs *GcsFs) Create(name string) (*GcsFile, error)

func (*GcsFs) Mkdir

func (fs *GcsFs) Mkdir(name string, _ os.FileMode) error

func (*GcsFs) MkdirAll

func (fs *GcsFs) MkdirAll(path string, perm os.FileMode) error

func (*GcsFs) Name

func (fs *GcsFs) Name() string

func (*GcsFs) Open

func (fs *GcsFs) Open(name string) (*GcsFile, error)

func (*GcsFs) OpenFile

func (fs *GcsFs) OpenFile(name string, flag int, fileMode os.FileMode) (*GcsFile, error)

func (*GcsFs) Remove

func (fs *GcsFs) Remove(name string) error

func (*GcsFs) RemoveAll

func (fs *GcsFs) RemoveAll(path string) error

func (*GcsFs) Rename

func (fs *GcsFs) Rename(oldName, newName string) error

func (*GcsFs) Stat

func (fs *GcsFs) Stat(name string) (os.FileInfo, error)

Source Files

errors.go file.go file_info.go file_resource.go fs.go

Version
v1.7.0
Published
Dec 22, 2021
Platform
linux/amd64
Imports
15 packages
Last checked
20 hours ago

Tools for package owners.