>_EXECUTIVE SUMMARY
stryke-gcp is one of the opt-in connector packages in the stryke ecosystem. Google Cloud client for stryke — Cloud Storage, Pub/Sub, Secret Manager, BigQuery, and Firestore. Opt-in package, kept out of the stryke core binary so the daily-driver install stays slim; ships as a Rust cdylib that stryke dlopens in-process on first use GCP.
GCP integration needs an auth chain (Application Default Credentials), a TLS HTTP client, and JSON serialization — fine to bundle once, opt-in. The cdylib talks to GCP's REST APIs directly via reqwest + google-cloud-auth.
~ARCHITECTURE
In-process cdylib design: the stryke side is a thin .stk wrapper that calls FFI symbols on the dlopen'd library. No subprocess, no pipe — calls return on the same thread that made them.
| Layer | Implementation |
|---|---|
stryke wrappers (lib/*.stk) | Thin .stk wrappers (GCP, GCP::Storage, GCP::PubSub, GCP::BigQuery, GCP::Firestore); each exposes typed helpers that serialize args to JSON and parse the response |
cdylib (libstryke_gcp.{dylib,so}) | Single Rust cdylib crate; every public surface fn is an extern "C" fn gcp__<verb>(*const c_char) -> *mut c_char |
| Process model | Library is dlopen'd once per stryke session on first use GCP; a shared tokio runtime + reqwest::Client + cached ADC credentials held in OnceCell; lives until the runtime exits |
| Build | Cargo with [lib] crate-type = ["cdylib"]; publish = false; the package itself ships via s pkg install -g . |
| Install path | ~/.stryke/store/gcp@<version>/ after make install; use GCP from any stryke script resolves it |
| Tests | zunit-style under t/ with live-service variants when applicable |
| CI | GitHub Actions .github/workflows/ci.yml — cargo fmt + clippy + test, plus stryke pkg install verification |
$WHY OPT-IN (NOT BUILTIN)
GCP client crates carry heavy gRPC + protobuf + auth chains. Opt-in keeps the core small.
The trade-off is intentional. The core stryke binary stays under ~40 MB precisely because each connector ships separately. Daily-driver work (one-liners, awk replacement, data scripting) doesn't need MongoDB drivers, AWS SDKs, or Spark Connect bindings linked in.
&FFI ENVELOPE
JSON in / JSON out across the FFI boundary. Each GCP::* wrapper serializes its args to a JSON dict and calls the matching gcp__* symbol on the dlopen'd libstryke_gcp.{dylib,so}; the cdylib returns a JSON CString the wrapper parses. catch_unwind on every call converts panics to JSON errors. The returned CString is freed via the cdylib-exported stryke_free_cstring, wired automatically by rust_ffi::load_cdylib.
# request shape (built by the .stk wrapper)
{"verb": "<op>", "...": ...}
# response shape
{"result": ...} # success — per-fn shape
{"error": "<msg>"} # failure — wrapper die()s with the message
+DEPENDENCIES
No heavyweight Google SDK crate. The cdylib talks to GCP's REST APIs directly, so the dependency set stays small and vendorable.
| Crate | Version | Role |
|---|---|---|
google-cloud-auth | 1 | Application Default Credentials chain (SA file / gcloud ADC / metadata server / WIF) |
reqwest | 0.12 | HTTPS client — rustls-tls-native-roots, json, stream (no default features) |
tokio | 1 | Async runtime — rt-multi-thread, macros, io-std, io-util, fs |
serde / serde_json | 1 | JSON serialization; preserve_order for stable response shapes |
base64 | 0.22 | Pub/Sub payload + Secret Manager value encoding |
urlencoding | 2 | GCS object-name / path encoding |
once_cell / parking_lot | 1 / 0.12 | Cached runtime + client + ADC credentials in OnceCell |
anyhow / http | 1 / 1 | Error plumbing + HTTP types |
Release profile: opt-level = 3, lto = "thin", codegen-units = 1, strip = true, panic = "abort". Crate is publish = false — distribution is via s pkg install / GitHub release artifacts, not crates.io.
*FFI EXPORT INVENTORY
84 gcp__* entry points, declared in stryke.toml's [ffi].exports table and matched 1:1 by #[no_mangle] pub extern "C" fn definitions in src/lib.rs. Grouped by service:
| Service | Exports |
|---|---|
| Plumbing | pkg_version, identity |
| Cloud Storage | gcs_list_buckets, gcs_list_objects, gcs_get_object, gcs_put_object, gcs_delete_object, gcs_head_object, gcs_copy_object, gcs_compose, gcs_get_iam_policy, gcs_set_iam_policy |
| Pub/Sub | pubsub_publish, pubsub_pull, pubsub_ack, pubsub_list_topics, pubsub_list_subscriptions, pubsub_create_topic, pubsub_create_subscription, pubsub_delete_topic, pubsub_delete_subscription, pubsub_get_topic, pubsub_topic_subscriptions |
| Secret Manager | secret_access, secret_create, secret_add_version, secret_list, secret_list_versions, secret_delete |
| BigQuery | bigquery_query, bigquery_insert, bigquery_list_datasets, bigquery_get_dataset, bigquery_list_tables, bigquery_get_table, bigquery_list_jobs |
| Firestore | firestore_get, firestore_set, firestore_delete, firestore_list, firestore_query, firestore_create |
| Compute Engine | compute_list_instances, compute_get_instance, compute_start_instance, compute_stop_instance, compute_reset_instance, compute_list_zones, compute_list_regions, compute_list_machine_types, compute_list_disks |
| Cloud Run | run_list_services, run_get_service, run_list_revisions |
| Cloud Functions | functions_list, functions_describe |
| Cloud Logging | logging_list_entries, logging_write_entry, logging_list_logs |
| Cloud Monitoring | monitoring_list_time_series, monitoring_list_metric_descriptors |
| IAM | iam_get_policy, iam_test_permissions, iam_list_service_accounts, iam_get_service_account |
| Pure helpers (no network) | parse_gs_uri, build_gs_uri, gs_uri_to_url, url_to_gs_uri, parse_resource_name, resource_name_parent, build_resource_name, parse_table_ref, build_table_ref, valid_bucket_name, valid_project_id, valid_object_name, region_for_zone, valid_label, valid_pubsub_id, valid_service_account_id, valid_secret_id, valid_dataset_id, valid_table_id |
/SCOPE
See the README's "Why this is a package" + "API reference" sections for the authoritative scope. The package is intentionally narrower than its underlying SDK / driver — the goal is "useful from a shell pipeline", not "complete API coverage".
#PROJECT METADATA
| Item | Value |
|---|---|
| License | MIT |
| Author | MenkeTechnologies |
| Repository | github.com/MenkeTechnologies/stryke-gcp |
| Parent language | strykelang |
| Meta umbrella | MenkeTechnologiesMeta |
| Issues | github.com/MenkeTechnologies/stryke-gcp/issues |