-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from socialcopsdev/update
Bugs solved and issues resolved.
- Loading branch information
Showing
9 changed files
with
109 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#' List buckets for cloud storage | ||
#' | ||
#' @param data_source default to local. Possible options : gcs, s3, local. Case insensitive | ||
#' @param gcs_project Project containing buckets to list in Google Cloud Storage | ||
#' | ||
#' @return vector of bucket names | ||
#' @import "googleCloudStorageR" "aws.s3" "assertthat" | ||
#' @export "list_bucket" | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' flyio_set_datasource("s3") | ||
#' flyio_auth() | ||
#' list_bucket() | ||
#' } | ||
list_bucket <- function(data_source = flyio_get_datasource(), gcs_project = ""){ | ||
|
||
# checking if data_source input is valid | ||
invisible(assertthat::assert_that(stringr::str_to_lower(data_source) %in% c("local", "gcs", "s3"), | ||
msg = "data_source should be either local, gcs or s3")) | ||
|
||
# if data source is local return | ||
if(str_to_lower(data_source) == "local"){ | ||
cat("data_source is set to Local. No buckets.\n") | ||
return(invisible("")) | ||
} | ||
|
||
# running authentication for set data source | ||
if(str_to_lower(data_source) == "gcs"){ | ||
invisible(assertthat::assert_that(gcs_project != "", | ||
msg = "Please specift the project containing buckets to list")) | ||
buckets = gcs_list_buckets(projectId = gcs_project) | ||
} else if(str_to_lower(data_source) == "s3"){ | ||
buckets = bucketlist() | ||
} | ||
return(buckets) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.