Expand description
Alien SDK for Rust.
Cloud-agnostic bindings for storage, KV, queues, vault, commands, and more. Works on AWS, GCP, Azure, Kubernetes, and locally.
This is the public-facing crate for Alien app developers. It re-exports
everything from alien_bindings, giving users the alien_sdk import path.
§Example
use alien_sdk::AlienContext;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ctx = AlienContext::init().await?;
ctx.on_command("hello", |params: serde_json::Value| async move {
Ok(serde_json::json!({ "message": "Hello!" }))
});
ctx.run().await?;
Ok(())
}Modules§
- alien_
context - AlienContext - Main SDK entry point for Alien applications.
- error
- grpc
- http_
client - presigned
- provider
- Unified BindingsProvider implementation that supports multiple cloud providers
- providers
- traits
Structs§
- Alien
Context - Main context for Alien applications that provides access to:
- Artifact
Registry Credentials - Credentials for accessing a repository.
- AwsService
Account Info - AWS IAM Role service account information
- Azure
Service Account Info - Azure User-Assigned Managed Identity information
- Bindings
Provider - Direct platform-specific bindings provider. Routes to appropriate platform implementations based on binding configuration.
- Control
Grpc Server - Control gRPC server implementation
- Drain
Config - Configuration for wait_until drain behavior.
- Drain
Response - Response from drain operations.
- GcpService
Account Info - GCP Service Account information
- Grpc
Server Handles - Handles returned from run_grpc_server
- Impersonation
Request - Configuration for impersonation
- Repository
Response - Response from repository operations.
- Wait
Until Context - A context for managing wait_until tasks within an application. This handles local task execution and coordinates with the runtime via gRPC.
Enums§
- Artifact
Registry Permissions - Permissions level for artifact registry access.
- Bindings
Mode - How bindings are delivered to the application
- Error
Data - Errors related to alien-bindings operations.
- Platform
- Represents the target cloud platform.
- Registry
Auth Method - How the registry expects credentials to be presented.
- Service
Account Info - Platform-specific service account information
Constants§
Traits§
- Artifact
Registry - A trait for artifact registry bindings that provide container image repository management.
- Binding
- Marker trait for all binding types.
- Bindings
Provider Api - A provider must implement methods to load the various types of bindings based on environment variables or other configuration sources.
- Build
- A build binding that provides build execution capabilities.
- Container
- A trait for container bindings that enable container-to-container communication
- Kv
- A trait for key-value store bindings that provide minimal, platform-agnostic KV operations. This API is designed to work consistently across DynamoDB, Firestore, Redis, and Azure Table Storage.
- Queue
- A trait for queue bindings providing minimal, portable queue operations.
- Service
Account - A service account binding that provides identity and impersonation capabilities.
- Storage
- A storage binding that provides object store capabilities.
- Vault
- A trait for vault bindings that provide secure secret management.
- Wait
Until - A trait for wait_until bindings that provide task coordination capabilities. Note: This trait is not object-safe due to generic methods, so we use concrete types in providers.
- Worker
- A trait for worker bindings that enable direct worker-to-worker calls.
Functions§
- get_
bindings_ mode_ from_ env - Parse ALIEN_BINDINGS_MODE from environment variables. Defaults to Direct if not specified.
- get_
current_ platform - Gets the current platform from the ALIEN_DEPLOYMENT_TYPE environment variable. This is used by the runtime to determine which platform-specific implementations to use.
- get_
platform_ from_ env - Gets the platform from a HashMap of environment variables.
Type Aliases§
- Result
- Convenient alias with default error type
ErrorData.