Public Types | Public Member Functions | Static Public Member Functions | List of all members
util::GCS Class Reference

Public Types

using ListBucketResult = util::StatusObject< std::vector< std::string > >
 
using ReadObjectResult = util::StatusObject< size_t >
 
using ListObjectResult = util::Status
 
using error_code = ::boost::system::error_code
 
using ListObjectCb = std::function< void(size_t, absl::string_view)>
 Called with (size, key_name) pairs.
 

Public Member Functions

 GCS (const GCE &gce, ::boost::asio::ssl::context *ssl_cntx, IoContext *io_context)
 
util::Status Connect (unsigned msec)
 
ListBucketResult ListBuckets ()
 
ListObjectResult List (absl::string_view bucket, absl::string_view prefix, bool fs_mode, ListObjectCb cb)
 
ReadObjectResult Read (absl::string_view bucket, absl::string_view path, size_t ofs, const strings::MutableByteRange &range)
 
template<typename RespBody >
Status SendWithToken (Request *req, Response< RespBody > *resp)
 

Static Public Member Functions

static bool SplitToBucketPath (absl::string_view input, absl::string_view *bucket, absl::string_view *path)
 
static std::string ToGcsPath (absl::string_view bucket, absl::string_view obj_path)
 Inverse function to SplitToBucketPath. Returns full gcs URI that starts with "gs://"".
 

Detailed Description

Definition at line 35 of file gcs.h.

Member Function Documentation

◆ List()

auto util::GCS::List ( absl::string_view  bucket,
absl::string_view  prefix,
bool  fs_mode,
ListObjectCb  cb 
)

fs_mode = true - will return files only without "/" delimiter after the prefix. fs_mode = false - will return all files recursively containing the prefix.

Definition at line 192 of file gcs.cc.

◆ SplitToBucketPath()

bool util::GCS::SplitToBucketPath ( absl::string_view  input,
absl::string_view *  bucket,
absl::string_view *  path 
)
static

Input: full gcs uri path that starts with "gs://" fills correspondent bucket and object paths. Returns true if succeeds and false otherwise.

Definition at line 331 of file gcs.cc.


The documentation for this class was generated from the following files: