mem_gcsclient

package
v0.0.0-...-4cd9e82 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryGCSClient

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

MemoryGCSClient is a struct used for testing. Instead of writing to GCS, it stores data in memory.

func New

func New(bucket string) *MemoryGCSClient

Return a MemoryGCSClient instance.

func (*MemoryGCSClient) AllFilesInDirectory

func (c *MemoryGCSClient) AllFilesInDirectory(ctx context.Context, prefix string, callback func(item *storage.ObjectAttrs) error) error

See documentation for GCSClient interface.

func (*MemoryGCSClient) Bucket

func (c *MemoryGCSClient) Bucket() string

See documentation for GCSClient interface.

func (*MemoryGCSClient) DeleteFile

func (c *MemoryGCSClient) DeleteFile(ctx context.Context, path string) error

See documentation for GCSClient interface.

func (*MemoryGCSClient) DoesFileExist

func (c *MemoryGCSClient) DoesFileExist(ctx context.Context, path string) (bool, error)

See documentation for GCSClient interface.

func (*MemoryGCSClient) FileReader

func (c *MemoryGCSClient) FileReader(ctx context.Context, path string) (io.ReadCloser, error)

See documentationn for GCSClient interface.

func (*MemoryGCSClient) FileWriter

func (c *MemoryGCSClient) FileWriter(ctx context.Context, path string, opts gcs.FileWriteOptions) io.WriteCloser

See documentation for GCSClient interface.

func (*MemoryGCSClient) GetFileContents

func (c *MemoryGCSClient) GetFileContents(ctx context.Context, path string) ([]byte, error)

See documentation for GCSClient interface.

func (*MemoryGCSClient) GetFileObjectAttrs

func (c *MemoryGCSClient) GetFileObjectAttrs(ctx context.Context, path string) (*storage.ObjectAttrs, error)

See documentation for GCSClient interface.

func (*MemoryGCSClient) SetFileContents

func (c *MemoryGCSClient) SetFileContents(ctx context.Context, path string, opts gcs.FileWriteOptions, contents []byte) error

See documentation for GCSClient interface.

Jump to

Keyboard shortcuts

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