gcs

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GSReadSeekCloser

type GSReadSeekCloser struct {
	*storage.ObjectHandle
	Context context.Context
	Closer  *func() error
	// contains filtered or unexported fields
}

func (*GSReadSeekCloser) Close

func (o *GSReadSeekCloser) Close() error

Satisfies io.Closer. If o.close is not set, this is a nop.

func (*GSReadSeekCloser) Read

func (s *GSReadSeekCloser) Read(buf []byte) (int, error)

func (*GSReadSeekCloser) Seek

func (s *GSReadSeekCloser) Seek(offset int64, whence int) (int64, error)

type Storage

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

func New

func New(ctx context.Context, cfg *storage.GcsConfig) (*Storage, error)

func (*Storage) ComposeObject

func (s *Storage) ComposeObject(ctx context.Context, bucketName string, dest string, srcs ...string) error

func (*Storage) CopyObject

func (s *Storage) CopyObject(ctx context.Context, dstBucket, dstPath, srcBucket, srcPath string) error

func (*Storage) CreateBucket

func (s *Storage) CreateBucket(ctx context.Context, name, region string) (string, error)

func (*Storage) DeleteBucket

func (s *Storage) DeleteBucket(ctx context.Context, name string) error

func (*Storage) DeleteObject

func (s *Storage) DeleteObject(ctx context.Context, bucket, path string) error

func (*Storage) DownloadObject

func (s *Storage) DownloadObject(ctx context.Context, bucket, path string) (io.ReadSeekCloser, error)

func (*Storage) GetBucket

func (s *Storage) GetBucket(ctx context.Context, name string) (*storage.Bucket, error)

func (*Storage) GetObject

func (s *Storage) GetObject(ctx context.Context, bucketName, path string) (*storage.Object, error)

func (*Storage) ListBuckets

func (s *Storage) ListBuckets(ctx context.Context) (iterator.Iterator[*storage.Bucket], error)

func (*Storage) ListObjects

func (s *Storage) ListObjects(ctx context.Context, bucketName, token, prefix,
	startpath, endpath string, recursive bool, limit uint32,
) (string, iterator.Iterator[*storage.ListObjectsResponse_Result], error)

func (*Storage) Test

func (s *Storage) Test(ctx context.Context) error

Test checks if the GCS client is able to connect to the GCS API.

func (*Storage) UploadObject

func (s *Storage) UploadObject(ctx context.Context, reader io.Reader, size int64, bucket, path, contentType string) (string, uint64, error)

Jump to

Keyboard shortcuts

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