testgcs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package testgcs is a light GCS client used for testings to avoid pulling in dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a lightweight GCS client for testing.

func NewClient

func NewClient(tp auth.TokenProvider) *Client

NewClient creates a Client using the provided cloud.google.com/go/auth.TokenProvider for authentication.

func (*Client) CreateBucket

func (c *Client) CreateBucket(ctx context.Context, projectID, bucket string) error

CreateBucket creates the specified bucket.

func (*Client) DeleteBucket

func (c *Client) DeleteBucket(ctx context.Context, bucket string) error

DeleteBucket deletes the specified bucket.

func (*Client) DownloadObject

func (c *Client) DownloadObject(ctx context.Context, bucket, object string) (*http.Response, error)

DownloadObject returns an http.Response who's body can be consumed to read the contents of an object.

Jump to

Keyboard shortcuts

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