func New()

in internal/output/gcs/gcs.go [29:40]


func New(opts *output.Options) (output.Output, error) {
	gcsClient, ctx, cancel, err := NewClient(opts.Addr)
	if err != nil {
		return nil, err
	}
	obj := gcsClient.Bucket(opts.GcsOptions.Bucket).Object(opts.GcsOptions.Object)
	writer := obj.NewWriter(ctx)
	// System tests are failing because a default content type is not set automatically, so we set it here instead.
	writer.ObjectAttrs.ContentType = opts.GcsOptions.ObjectContentType

	return &Output{opts: opts, client: gcsClient, cancelFunc: cancel, writer: writer}, nil
}