pub struct GcsClient { /* private fields */ }Expand description
Minimal GCS client using the JSON API. Authenticates via service account JWT.
Implementations§
Source§impl GcsClient
impl GcsClient
Sourcepub fn new(bucket: String, service_account_json: &str) -> Result<Self, GcsError>
pub fn new(bucket: String, service_account_json: &str) -> Result<Self, GcsError>
Create a new read-only GCS client (used by the skill registry loader).
Sourcepub fn new_read_write(
bucket: String,
service_account_json: &str,
) -> Result<Self, GcsError>
pub fn new_read_write( bucket: String, service_account_json: &str, ) -> Result<Self, GcsError>
Create a read/write GCS client (used by the file_manager upload tool).
Sourcepub async fn list_skill_names(&self) -> Result<Vec<String>, GcsError>
pub async fn list_skill_names(&self) -> Result<Vec<String>, GcsError>
List top-level “directories” (prefixes) in the bucket.
Returns skill names like ["fal-generate", "compliance-screening", ...].
Sourcepub async fn list_objects(&self, prefix: &str) -> Result<Vec<String>, GcsError>
pub async fn list_objects(&self, prefix: &str) -> Result<Vec<String>, GcsError>
List all objects under a prefix (recursive).
Returns relative paths like ["SKILL.md", "skill.toml", "scripts/generate.sh"].
Sourcepub async fn get_object(&self, path: &str) -> Result<Vec<u8>, GcsError>
pub async fn get_object(&self, path: &str) -> Result<Vec<u8>, GcsError>
Read a single object as bytes.
Sourcepub async fn get_object_text(&self, path: &str) -> Result<String, GcsError>
pub async fn get_object_text(&self, path: &str) -> Result<String, GcsError>
Read a single object as UTF-8 text.
Sourcepub async fn upload_object(
&self,
object_name: &str,
bytes: Vec<u8>,
content_type: &str,
) -> Result<String, GcsError>
pub async fn upload_object( &self, object_name: &str, bytes: Vec<u8>, content_type: &str, ) -> Result<String, GcsError>
Upload bytes to <bucket>/<object_name> using the GCS JSON simple upload API.
Returns the public-style URL https://storage.googleapis.com/<bucket>/<object_name>.
The object is not made public — the URL only resolves if the bucket grants
public read access, which is the proxy-operator’s responsibility to configure.