package
0.2.16
Repository: https://github.com/lytics/cloudstorage.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

google cloud storage store

Cloudstorage abstraction package for gcs.

# the CloudStorage GCS JWT key is an env with full jwt token json encoded.
export CS_GCS_JWTKEY="{\"project_id\": \"lio-testing\", \"private_key_id\": \"

Example


// example with  CS_GCS_JWTKEY env var
conf := &cloudstorage.Config{
	Type:       google.StoreType,
	AuthMethod: google.AuthJWTKeySource,
	Project:    "my-google-project",
	Bucket:     "integration-tests-nl",
	TmpDir:     "/tmp/localcache/google",
}

// OR read from machine oauth locations
conf := &cloudstorage.Config{
	Type:       google.StoreType,
	AuthMethod: google.AuthGCEDefaultOAuthToken,
	Project:    "my-google-project",
	Bucket:     "integration-tests-nl",
	TmpDir:     "/tmp/localcache/google",
}

// OR metadata api if on google cloud
conf := &cloudstorage.Config{
	Type:       google.StoreType,
	AuthMethod: google.AuthGCEMetaKeySource,
	Project:    "my-google-project",
	Bucket:     "integration-tests-nl",
	TmpDir:     "/tmp/localcache/google",
}

// create store
store, err := cloudstorage.NewStore(conf)
if err != nil {
    return err
}