gcsfs

package
v0.0.0-...-78f71ff Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidBehaviour = iota
	Panic
	Warn
	Ignore
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Behaviour

type Behaviour int

type FileInfo

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

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

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

func (*FileInfo) Mode

func (f *FileInfo) Mode() fs.FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() any

type FsInfo

type FsInfo struct {
	Name string
}

func (*FsInfo) GetName

func (fs *FsInfo) GetName() string

type GCS

type GCS struct {
	BehaviourMode Behaviour
	// contains filtered or unexported fields
}

func New

func New(bucketName string, behaviourMode Behaviour) *GCS

func (*GCS) Append

func (g *GCS) Append(ctx context.Context, name string) (dfsapi.FileWriter, error)

func (*GCS) Chmod

func (g *GCS) Chmod(ctx context.Context, name string, perm os.FileMode) error

func (*GCS) Chown

func (g *GCS) Chown(ctx context.Context, name string, user, group string) error

func (*GCS) Chtimes

func (g *GCS) Chtimes(ctx context.Context, name string, atime time.Time, mtime time.Time) error

func (*GCS) Close

func (g *GCS) Close(ctx context.Context) error

Close - there is nothing to do for GCS Close()

func (*GCS) CopyToLocal

func (g *GCS) CopyToLocal(ctx context.Context, src string, dst string) error

func (*GCS) CopyToRemote

func (g *GCS) CopyToRemote(ctx context.Context, src string, dst string) error

func (*GCS) Create

func (g *GCS) Create(ctx context.Context, name string) (dfsapi.FileWriter, error)

func (*GCS) CreateEmptyFile

func (g *GCS) CreateEmptyFile(ctx context.Context, name string) error

func (*GCS) CreateFile

func (g *GCS) CreateFile(ctx context.Context, name string, _ int, _ int64, _ os.FileMode) (dfsapi.FileWriter, error)

func (*GCS) GetContentSummary

func (g *GCS) GetContentSummary(ctx context.Context, path string) (*dfsapi.ContentSummary, error)

func (*GCS) Mkdir

func (g *GCS) Mkdir(ctx context.Context, dirname string, perm os.FileMode) error

func (*GCS) MkdirAll

func (g *GCS) MkdirAll(ctx context.Context, dirname string, perm os.FileMode) error

func (*GCS) Open

func (g *GCS) Open(ctx context.Context, name string) (dfsapi.FileReader, error)

func (*GCS) ReadDir

func (g *GCS) ReadDir(ctx context.Context, dirname string) ([]os.FileInfo, error)

func (*GCS) ReadFile

func (g *GCS) ReadFile(ctx context.Context, filename string) ([]byte, error)

func (*GCS) Remove

func (g *GCS) Remove(ctx context.Context, name string) error

func (*GCS) RemoveAll

func (g *GCS) RemoveAll(ctx context.Context, dirname string) error

RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error).

func (*GCS) Rename

func (g *GCS) Rename(ctx context.Context, oldpath, newpath string) error

Rename an existing GCS object GCS SDK Documentation states that we must copy the object to the new name and then delete the old one.

> To move or rename an object using the JSON API directly, first make a copy of the object > that has the properties you want and then delete the original object.

Found the Copier() API that provides an elegant way to copy large objects.

func (*GCS) RenameWithOverwriteOption

func (g *GCS) RenameWithOverwriteOption(ctx context.Context, oldpath, newpath string, overwrite bool) error

func (*GCS) Stat

func (g *GCS) Stat(ctx context.Context, name string) (os.FileInfo, error)

func (*GCS) StatFs

func (g *GCS) StatFs(_ context.Context) (dfsapi.FsInfo, error)

func (*GCS) User

func (g *GCS) User(ctx context.Context) string

func (*GCS) Walk

func (g *GCS) Walk(_ context.Context, _ string, _ filepath.WalkFunc) error

type TransactionClient

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

Jump to

Keyboard shortcuts

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