// STRYKE-GCP — ENGINEERING REPORT

Opt-in stryke connector package · cdylib libstryke_gcp.{dylib,so} (crate-type = cdylib) · dlopen'd in-process on use GCP · JSON-over-FFI envelope

>_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.

cdylib
Crate type
opt-in
Tier
dlopen
Load model
JSON-over-FFI
Envelope
84
gcp__* FFI exports
12
Service families
11
.stk wrapper modules
v0.19.0
Version

~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.

LayerImplementation
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 modelLibrary 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
BuildCargo 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
Testszunit-style under t/ with live-service variants when applicable
CIGitHub 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.

CrateVersionRole
google-cloud-auth1Application Default Credentials chain (SA file / gcloud ADC / metadata server / WIF)
reqwest0.12HTTPS client — rustls-tls-native-roots, json, stream (no default features)
tokio1Async runtime — rt-multi-thread, macros, io-std, io-util, fs
serde / serde_json1JSON serialization; preserve_order for stable response shapes
base640.22Pub/Sub payload + Secret Manager value encoding
urlencoding2GCS object-name / path encoding
once_cell / parking_lot1 / 0.12Cached runtime + client + ADC credentials in OnceCell
anyhow / http1 / 1Error 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:

ServiceExports
Plumbingpkg_version, identity
Cloud Storagegcs_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/Subpubsub_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 Managersecret_access, secret_create, secret_add_version, secret_list, secret_list_versions, secret_delete
BigQuerybigquery_query, bigquery_insert, bigquery_list_datasets, bigquery_get_dataset, bigquery_list_tables, bigquery_get_table, bigquery_list_jobs
Firestorefirestore_get, firestore_set, firestore_delete, firestore_list, firestore_query, firestore_create
Compute Enginecompute_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 Runrun_list_services, run_get_service, run_list_revisions
Cloud Functionsfunctions_list, functions_describe
Cloud Logginglogging_list_entries, logging_write_entry, logging_list_logs
Cloud Monitoringmonitoring_list_time_series, monitoring_list_metric_descriptors
IAMiam_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

ItemValue
LicenseMIT
AuthorMenkeTechnologies
Repositorygithub.com/MenkeTechnologies/stryke-gcp
Parent languagestrykelang
Meta umbrellaMenkeTechnologiesMeta
Issuesgithub.com/MenkeTechnologies/stryke-gcp/issues