func New(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
	opts = append(opts, option.WithUserAgent(UserAgent))
	var c Client
	kmsClient, err := kms.NewKeyManagementClient(ctx, opts...)
	if err != nil {
		return nil, errors.Wrap(err, "failed to create kms client")
	}
	c.kmsClient = kmsClient
	secretManagerClient, err := secretmanager.NewClient(ctx, opts...)
	if err != nil {
		return nil, errors.Wrap(err, "failed to create secretManager client")
	}
	c.secretManagerClient = secretManagerClient
	storageClient, err := storage.NewClient(ctx, opts...)
	if err != nil {
		return nil, errors.Wrap(err, "failed to create storage client")
	}
	c.storageClient = storageClient
	storageIAMClient, err := storagev1.NewService(ctx, opts...)
	if err != nil {
		return nil, errors.Wrap(err, "failed to create storagev1 client")
	}
	c.storageIAMClient = storageIAMClient
	c.logger = &logrus.Logger{
		Out:          os.Stderr,
		Formatter:    new(logrus.JSONFormatter),
		Hooks:        make(logrus.LevelHooks),
		Level:        logrus.FatalLevel,
		ReportCaller: true,
	}
	return &c, nil
}
New creates a new berglas client.
package berglas
import (
	"context"
	"crypto/aes"
	"crypto/cipher"
	"crypto/rand"
	"io"
	"os"
	"strings"
	"sync"
	"time"
	kms "cloud.google.com/go/kms/apiv1"
	secretmanager "cloud.google.com/go/secretmanager/apiv1"
	"cloud.google.com/go/storage"
	"github.com/golang/protobuf/ptypes/timestamp"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"google.golang.org/api/option"
	storagev1 "google.golang.org/api/storage/v1"
)
const (
	Name       = "berglas"
	Version    = "0.6.2"
	ProjectURL = "https://github.com/GoogleCloudPlatform/berglas"
	UserAgent  = Name + "/" + Version + " (+" + ProjectURL + ")"
)
const (
	CacheControl = "private, no-cache, no-store, no-transform, max-age=0"
	ChunkSize = 1024
	MetadataIDKey = "berglas-secret"
	MetadataKMSKey = "berglas-kms-key"
)
type Client struct {
	kmsClient           *kms.KeyManagementClient
	secretManagerClient *secretmanager.Client
	storageClient       *storage.Client
	storageIAMClient    *storagev1.Service
	loggerLock sync.RWMutex
	logger     *logrus.Logger
}