gcs

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileClosed   = errors.New("File is closed")
	ErrOutOfRange   = errors.New("Out of range")
	ErrTooLarge     = errors.New("Too large")
	ErrFileNotFound = os.ErrNotExist
)

Functions

This section is empty.

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 GcsFile

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

GcsFs is the Afero version adapted for GCS

func NewGcsFile

func NewGcsFile(
	fs *GcsFs,
	ctx context.Context,
	obj *storage.ObjectHandle,
	openFlags int,
	name string,
) (*GcsFile, error)

func (*GcsFile) CanMmap

func (f *GcsFile) CanMmap() bool

func (*GcsFile) Close

func (f *GcsFile) Close() error

func (*GcsFile) Mmap

func (f *GcsFile) Mmap(offset int64, length int, prot int, flags int) ([]byte, error)

func (*GcsFile) Munmap

func (f *GcsFile) Munmap() error

func (*GcsFile) Name

func (f *GcsFile) Name() string

func (*GcsFile) Read

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

func (*GcsFile) ReadAt

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

func (*GcsFile) Readdir

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

func (*GcsFile) Readdirnames

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

func (*GcsFile) Seek

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

func (*GcsFile) Stat

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

func (*GcsFile) Sync

func (f *GcsFile) Sync() error

func (*GcsFile) Truncate

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

func (*GcsFile) Write

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

func (*GcsFile) WriteAt

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

func (*GcsFile) WriteString

func (f *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, cl *storage.Client, bucket string, folderSep string) *GcsFs

func (*GcsFs) Chmod

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

func (*GcsFs) Chtimes

func (fs *GcsFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*GcsFs) Create

func (fs *GcsFs) Create(name string) (kafero.File, error)

func (*GcsFs) Mkdir

func (fs *GcsFs) Mkdir(name string, perm 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) (kafero.File, error)

func (*GcsFs) OpenFile

func (fs *GcsFs) OpenFile(name string, flag int, perm os.FileMode) (kafero.File, 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)

Jump to

Keyboard shortcuts

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