MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / NewClient

Function NewClient

lib/gcpgcs/client.go:36–43  ·  view source on GitHub ↗

NewClient creates a new GCP GCS client. It automatically respects STORAGE_EMULATOR_HOST if set in the environment.

(ctx context.Context, bucket string)

Source from the content-addressed store, hash-verified

34// NewClient creates a new GCP GCS client.
35// It automatically respects STORAGE_EMULATOR_HOST if set in the environment.
36func NewClient(ctx context.Context, bucket string) (*Client, error) {
37 storageClient, err := storage.NewClient(ctx)
38 if err != nil {
39 return nil, err
40 }
41
42 return &Client{client: storageClient, bucket: bucket}, nil
43}
44
45func (c *Client) Close() error {
46 return c.client.Close()

Callers 1

newTestGCSClientFunction · 0.70

Calls

no outgoing calls

Tested by 1

newTestGCSClientFunction · 0.56