Documentation ¶
Index ¶
Constants ¶
const DefaultCredentialsSource = ""
DefaultCredentialsSource specifies that credentials should be detected. Application Default Credentials will be used if avaliable. A read-only client will be used otherwise.
const NoneCredentialsSource = "none"
NoneCredentialsSource specifies that credentials are explicitly empty and that the client should be restricted to a read-only scope.
const ServiceAccountFileCredentialsSource = "static"
ServiceAccountFileCredentialsSource specifies that a service account file included in json_key should be used for authentication.
Variables ¶
var ErrEmptyBucketName = errors.New("bucket_name must be set")
ErrEmptyBucketName is returned when a bucket_name in the config is empty
var ErrEmptyServiceAccountFile = errors.New("json_key must be set")
ErrEmptyServiceAccountFile is returned when json_key in the config is empty when StaticCredentialsSource is explicitly requested.
var ErrWrongLengthEncryptionKey = errors.New("encryption_key not 32 bytes")
ErrWrongLengthEncryptionKey is returned when a non-nil encryption_key in the config is not exactly 32 bytes.
Functions ¶
This section is empty.
Types ¶
type GCSCli ¶
type GCSCli struct { // BucketName is the GCS bucket operations will use. BucketName string `json:"bucket_name"` // CredentialsSource is the location of a Service Account File. // If left empty, Application Default Credentials will be used if available. // If equal to 'none', read-only scope will be used. // If equal to 'static', json_key will be used. CredentialsSource string `json:"credentials_source"` // ServiceAccountFile is the contents of a JSON Service Account File. // Required if credentials_source is 'static', otherwise ignored. ServiceAccountFile string `json:"json_key"` // StorageClass is the type of storage used for objects added to the bucket // https://cloud.google.com/storage/docs/storage-classes StorageClass string `json:"storage_class"` // EncryptionKey is a Customer-Supplied encryption key used to // encrypt objects added to the bucket. // If left empty, no explicit encryption key will be used; // GCS transparently encrypts data using server-side encryption keys. // https://cloud.google.com/storage/docs/encryption EncryptionKey []byte `json:"encryption_key"` EncryptionKeyEncoded string EncryptionKeySha256 string }
GCSCli represents the configuration for the gcscli