### Navigate to Order-processor Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/secrets-quickstart.md Changes the current directory to the order-processor example within the cloned quickstarts repository. ```bash cd secrets_management/go/sdk/order-processor ``` -------------------------------- ### Install NPM Packages Source: https://github.com/dapr/docs/blob/v1.18/README.md Installs the required Node.js packages for the project. This step is part of the manual environment setup. ```shell npm install ``` -------------------------------- ### Set Up Python Virtual Environment and Install Dependencies Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/developing-ai/dapr-agents/dapr-agents-getting-started.md Create and activate a Python virtual environment, then install project dependencies using uv. This ensures all necessary libraries for the Dapr Agents examples are available. ```bash uv venv # Activate the virtual environment # On Windows: .venv\Scripts\activate # On macOS/Linux: source .venv/bin/activate # Install dependencies uv sync --active ``` -------------------------------- ### Navigate to Pub/Sub Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md Changes the current directory to the JavaScript pub/sub example within the cloned quickstarts repository. ```bash cd pub_sub/javascript/sdk ``` -------------------------------- ### Install Java Application Dependencies with Maven Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md Maven commands to clean, install, and build the dependencies for both the order-processor and checkout applications within the Java HTTP quickstart. ```bash cd ./order-processor mvn clean install cd ../checkout mvn clean install cd .. ``` -------------------------------- ### Clone Dapr Agents Repository Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/developing-ai/dapr-agents/dapr-agents-getting-started.md Clone the Dapr Agents repository to access the quickstart examples. Navigate into the quickstarts directory. ```bash git clone https://github.com/dapr/dapr-agents.git cd dapr-agents/quickstarts ``` -------------------------------- ### Initialize Dapr CLI with Slim Installation Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/install-dapr-selfhost.md Installs the Dapr CLI without default configuration files or Docker containers, using the `--slim` flag for a minimal setup. ```bash dapr init --slim ``` -------------------------------- ### Navigate to Order Processor Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/resiliency/resiliency-state-quickstart.md Changes the current directory to the JavaScript SDK's order-processor example within the cloned quickstarts repository. ```bash cd ../state_management/javascript/sdk/order-processor ``` -------------------------------- ### Navigate to the StateManagementExample directory Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/dotnet/content/en/dotnet-sdk-docs/dotnet-state-management/dotnet-statemanagement-howto.md Enter the StateManagementExample directory to prepare for running the application. ```sh cd StateManagementExample ``` -------------------------------- ### Run JavaScript Application with Dapr Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/cryptography-quickstart.md Starts the JavaScript cryptography quickstart application using Dapr. Ensure Dapr is installed and the environment is initialized. ```bash dapr run --app-id crypto-quickstart --resources-path ../../../components/ -- npm start ``` -------------------------------- ### Create and Start a Basic PHP Dapr App Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/php/content/en/php-sdk-docs/php-app/_index.md This snippet demonstrates the basic setup for a PHP Dapr application. It shows how to create an App instance, configure it with DI definitions, define a simple GET route, and start the application to handle incoming requests. ```php $builder->addDefinitions('config.php')); // add a controller for GET /test/{id} that returns the id $app->get('/test/{id}', fn(string $id) => $id); $app->start(); ``` -------------------------------- ### Return to the SDK directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md Navigate back to the parent directory containing the SDK examples. ```bash cd .. ``` -------------------------------- ### Navigate to C# Pub/Sub SDK Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md Change the directory to the C# SDK sample for the pub/sub quickstart. ```bash cd pub_sub/csharp/sdk ``` -------------------------------- ### Bulk Get Response Example Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md Example response body for a bulk get operation, showing results for each item including data or errors. ```json [ { "key": "file1.txt", "data": "contents of file1" }, { "key": "file2.txt", "data": "contents of file2" }, { "key": "missing.txt", "error": "object not found" } ] ``` -------------------------------- ### Navigate to Bindings DB Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/bindings-quickstart.md Navigate to the 'bindings/db' directory within the cloned quickstarts repository to set up the PostgreSQL container. ```bash cd bindings/db ``` -------------------------------- ### Get Object Example (Linux) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md Example of how to get an object from GCP Bucket using curl on Linux. Replace and with your specific values. ```bash curl -d '{ "operation": "get", "metadata": { "key": "my-test-file.txt" }}' \ http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Get Object Example (Windows) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md Example of how to get an object from GCP Bucket using curl on Windows. Replace and with your specific values. ```bash curl -d '{ "operation": "get", "metadata": { "key": "my-test-file.txt" }}' http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Install Dependencies Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/contributing/dapr-agents.md Install the main package with optional dependencies like test or dev. ```bash # Install main package with test dependencies pip install -e ".[test]" # Install main package with development dependencies pip install -e ".[dev]" # Install main package with all optional dependencies pip install -e ".[test,dev]" ``` -------------------------------- ### Manage Workflow Instances Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/js/content/en/js-sdk-docs/js-client/_index.md Provides examples for managing workflow instances using the Dapr JavaScript SDK. This includes starting, getting, pausing, resuming, terminating, and purging workflow instances. Ensure the Dapr sidecar is running and the workflow component is configured. ```typescript import { DaprClient } from "@dapr/dapr"; async function start() { const client = new DaprClient(); // Start a new workflow instance const instanceId = await client.workflow.start("OrderProcessingWorkflow", { Name: "Paperclips", TotalCost: 99.95, Quantity: 4, }); console.log(`Started workflow instance ${instanceId}`); // Get a workflow instance const workflow = await client.workflow.get(instanceId); console.log( `Workflow ${workflow.workflowName}, created at ${workflow.createdAt.toUTCString()}, has status ${ workflow.runtimeStatus }`, ); console.log(`Additional properties: ${JSON.stringify(workflow.properties)}`); // Pause a workflow instance await client.workflow.pause(instanceId); console.log(`Paused workflow instance ${instanceId}`); // Resume a workflow instance await client.workflow.resume(instanceId); console.log(`Resumed workflow instance ${instanceId}`); // Terminate a workflow instance await client.workflow.terminate(instanceId); console.log(`Terminated workflow instance ${instanceId}`); // Purge a workflow instance await client.workflow.purge(instanceId); console.log(`Purged workflow instance ${instanceId}`); } start().catch((e) => { console.error(e); process.exit(1); }); ``` -------------------------------- ### Navigate to Service Invocation Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md Change directory to the specific quickstart sample for HTTP-based service invocation. ```bash cd service_invocation/javascript/http ``` -------------------------------- ### Bulk Get Objects cURL Example (Linux) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md Example cURL command to perform a bulk get operation on Linux. Ensure to replace placeholders like and . ```bash curl -d '{ "operation": "bulkGet", "data": { "items": [{ "key": "file1.txt" }, { "key": "file2.txt" }], "concurrency": 5 } }' \ http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Navigate to Java HTTP Quickstart Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md Bash commands to navigate into the cloned quickstarts directory and then into the specific Java HTTP service invocation quickstart. ```bash cd service_invocation/java/http ``` -------------------------------- ### Clone Quickstarts Repository Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/actors-quickstart.md Clone the repository containing the C# actor quickstart samples. ```bash git clone https://github.com/dapr/quickstarts.git ``` -------------------------------- ### Bulk Get Objects cURL Example (Windows) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md Example cURL command to perform a bulk get operation on Windows. Ensure to replace placeholders like and . ```bash curl -d "{ \"operation\": \"bulkGet\", \"data\": { \"items\": [{ \"key\": \"file1.txt\" }, { \"key\": \"file2.txt\" }], \"concurrency\": 5 } }" http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Navigate to Crypto Quickstart Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/cryptography-quickstart.md Change the current directory to the crypto-quickstart folder. ```bash cd ./crypto-quickstart ``` -------------------------------- ### Bulk Get Objects Example (Linux) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md Example of how to perform a bulk get operation on GCP Bucket using curl on Linux. Replace and with your specific values. ```bash curl -d '{ "operation": "bulkGet"}' \ http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Bulk Get Objects Example (Windows) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md Example of how to perform a bulk get operation on GCP Bucket using curl on Windows. Replace and with your specific values. ```bash curl -d '{ "operation": "bulkGet"}' http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Navigate to Jobs Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/jobs-quickstart.md Navigate into the Go SDK jobs directory within the cloned quickstarts repository. ```bash cd jobs/go/sdk ``` -------------------------------- ### Get Actor Reminder Response Example Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/api/actors_api.md Example JSON response when retrieving an actor reminder. ```json { "dueTime": "1s", "period": "5s", "data": "0", } ``` -------------------------------- ### Get State Response Body Example Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/api/state_api.md Example JSON response body when retrieving state successfully. ```json { "name": "Tatooine" } ``` -------------------------------- ### Navigate to Order Processor Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/resiliency/resiliency-state-quickstart.md Change directory to the Go SDK's order-processor sample within the cloned quickstarts repository. ```bash cd ../state_management/go/sdk/order-processor ``` -------------------------------- ### Navigate to Pub/Sub Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md Changes the current directory to the Java pub/sub quickstart samples. ```bash cd pub_sub/java/sdk ``` -------------------------------- ### Install and Build .NET Dependencies Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md Install and build the dependencies for both the order-processor and checkout applications. ```bash cd ./order-processor dotnet restore dotnet build cd ../checkout dotnet restore dotnet build cd .. ``` -------------------------------- ### Example curl command to get configuration Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/api/configuration_api.md This example demonstrates how to use curl to fetch a specific configuration item from a Dapr store. ```shell curl -X GET 'http://localhost:3500/v1.0/configuration/mystore?key=myConfigKey' ``` -------------------------------- ### Navigate to Checkout Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md Change directory to the Python checkout publisher sample within the cloned quickstarts repository. ```bash cd pub_sub/python/sdk/checkout ``` -------------------------------- ### Install Redis in Kubernetes using Helm Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/tutorials/configure-state-pubsub.md Installs Redis into a Kubernetes cluster using Helm. Ensure Helm v3 is installed first. The command creates a standalone Redis setup by default. ```bash helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update helm install redis bitnami/redis --set image.tag=6.2 ``` -------------------------------- ### Navigate to .NET Conversation Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md Navigate to the C# conversation sample directory within the cloned quickstarts repository. ```bash cd conversation/csharp/sdk/conversation ``` -------------------------------- ### Get State Example with Curl Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/api/state_api.md Example using curl to retrieve state from the 'starwars' store for the key 'planet', including content type metadata. ```shell curl http://localhost:3500/v1.0/state/starwars/planet?metadata.contentType=application/json ``` -------------------------------- ### Navigate to Order Processor Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md Change directory to the Python order-processor sample within the cloned quickstarts repository. ```bash cd pub_sub/python/sdk/order-processor ``` -------------------------------- ### Install Java SDK Requirements Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/java/content/en/java-sdk-docs/java-ai/java-ai-howto.md Installs the necessary requirements for running the Conversation AI example using Apache Maven. It skips tests to speed up the process. ```bash mvn clean install -DskipTests ``` -------------------------------- ### Example: Set Dapr Operator Log Level with Helm Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/operations/troubleshooting/logs-troubleshooting.md An example of setting the log level to 'error' for the Dapr operator component using Helm during installation. ```bash helm install dapr dapr/dapr --namespace dapr-system --set dapr_operator.logLevel=error ``` -------------------------------- ### Navigate to Python SDK Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/secrets-quickstart.md Navigate to the order-processor directory for the Python SDK example. ```bash cd secrets_management/python/sdk/order-processor ``` -------------------------------- ### Tabbed Content Example Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/contributing/docs-contrib/contributing-docs.md Provides a complete example of Hugo shortcodes for creating tabbed content, with each tab containing installation commands for different operating systems. ```html {{< tabpane text=true >}} {{% tab header="Windows" %}} ```powershell powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex" ``` {{% /tab %}} {{% tab header="Linux" %}} ```bash wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash ``` {{% /tab %}} {{% tab header="MacOS" %}} ```bash brew install dapr/tap/dapr-cli ``` {{% /tab %}} {{< /tabpane >}} ``` -------------------------------- ### Call State Store API (GET) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/operations/components/pluggable-components-registration.md Example of how to retrieve data from a state store using a GET request. Replace `$PORT` with the Dapr HTTP port. ```shell curl http://localhost:$PORT/v1.0/state/prod-mystore/name ``` -------------------------------- ### Navigate to Go SDK Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md Change directory to the Go SDK part of the conversation quickstart within the cloned repository. ```bash cd conversation/go/sdk ``` -------------------------------- ### Navigate to Go Conversation Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md Change directory to the Go SDK conversation sample within the cloned quickstarts repository. ```bash cd conversation/go/sdk/conversation ``` -------------------------------- ### Navigate to Pub/Sub Go SDK Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md Change directory into the Go SDK specific part of the pub/sub quickstart. ```bash cd pub_sub/go/sdk ``` -------------------------------- ### Bulk Get Blobs to Files (Linux cURL) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md Example using cURL on Linux to perform a bulk get operation, streaming blobs to specified file paths. ```bash curl -d '{ "operation": "bulkGet", "data": { "items": [{ "blobName": "file1.txt", "filePath": "/tmp/file1.txt" }, { "blobName": "file2.txt", "filePath": "/tmp/file2.txt" }] } }' \ http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Initialize Go Module Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/pluggable-components/go/content/en/go-sdk-docs/_index.md Create a new directory and initialize a Go module for your pluggable component project. ```bash mkdir example cd example go mod init example ``` -------------------------------- ### Bulk Get Blobs to Files (Windows cURL) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md Example using cURL on Windows to perform a bulk get operation, streaming blobs to specified file paths. ```bash curl -d "{ \"operation\": \"bulkGet\", \"data\": { \"items\": [{ \"blobName\": \"file1.txt\", \"filePath\": \"C:\\\\tmp\\\\file1.txt\" }, { \"blobName\": \"file2.txt\", \"filePath\": \"C:\\\\tmp\\\\file2.txt\" }] } }" http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Bulk Get Blobs by Prefix (Linux cURL) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md Example using cURL on Linux to perform a bulk get operation, downloading blobs matching a prefix to a destination directory. ```bash curl -d '{ "operation": "bulkGet", "data": { "prefix": "backups/", "destinationDir": "/tmp/backups", "concurrency": 5 } }' \ ``` -------------------------------- ### Navigate to Order Processor Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md Change the current directory to the Java order-processor sample within the cloned quickstarts repository. This is necessary to access the project files. ```bash cd workflows/java/sdk/order-processor ``` -------------------------------- ### Navigate to Java Order Processor Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/configuration-quickstart.md Change the current directory to the Java order-processor sample within the cloned quickstarts repository. ```bash cd configuration/java/sdk/order-processor ``` -------------------------------- ### Bulk Get Blobs by Prefix (Windows cURL) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md Example using cURL on Windows to perform a bulk get operation, downloading blobs matching a prefix to a destination directory. ```bash curl -d "{ \"operation\": \"bulkGet\", \"data\": { \"prefix\": \"backups/\", \"destinationDir\": \"C:\\\\tmp\\\\backups\", \"concurrency\": 5 } }" http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Navigate to Workflow Example Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/python/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/python-workflow.md Change directory to the Dapr Workflow example within the cloned Python SDK repository. ```bash cd examples/workflow ``` -------------------------------- ### Oracle Database State Store Bulk Get Chunk Size Example Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-oracledatabase.md Example of configuring the maximum number of keys per internal SQL query for BulkGet operations. ```shell "100" ``` -------------------------------- ### Navigate to Order Processor Directory (.NET) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/configuration-quickstart.md Change the current directory to the order-processor service within the cloned quickstarts repository for the .NET SDK. ```bash cd configuration/csharp/sdk/order-processor ``` -------------------------------- ### Navigate to checkout Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/resiliency/resiliency-serviceinvo-quickstart.md Change directory to the checkout service within the cloned quickstarts repository. ```bash cd service_invocation/python/http/checkout ``` -------------------------------- ### PHP Actor State Versioning Example Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/php/content/en/php-sdk-docs/php-actors/php-actor-reference.md This example demonstrates how to override state loading and storing to version actor state. It includes methods for upgrading state, getting versioned keys, and handling get, set, isset, and unset operations for different state versions. Use this as a reference for implementing your own state versioning strategy. ```php state_version < self::VERSION) { $value = parent::__get($this->get_versioned_key('key', $this->state_version)); // update the value after updating the data structure parent::__set($this->get_versioned_key('key', self::VERSION), $value); $this->state_version = self::VERSION; $this->save_state(); } } // if you upgrade all keys as needed in the method above, you don't need to walk the previous // keys when loading/saving and you can just get the current version of the key. private function get_previous_version(int $version): int { return $this->has_previous_version($version) ? $version - 1 : $version; } private function has_previous_version(int $version): bool { return $version >= 0; } private function walk_versions(int $version, callable $callback, callable $predicate): mixed { $value = $callback($version); if($predicate($value) || !$this->has_previous_version($version)) { return $value; } return $this->walk_versions($this->get_previous_version($version), $callback, $predicate); } private function get_versioned_key(string $key, int $version) { return $this->has_previous_version($version) ? $version.$key : $key; } public function __get(string $key): mixed { return $this->walk_versions( self::VERSION, fn($version) => parent::__get($this->get_versioned_key($key, $version)), fn($value) => isset($value) ); } public function __isset(string $key): bool { return $this->walk_versions( self::VERSION, fn($version) => parent::__isset($this->get_versioned_key($key, $version)), fn($isset) => $isset ); } public function __set(string $key,mixed $value): void { // optional: you can unset previous versions of the key parent::__set($this->get_versioned_key($key, self::VERSION), $value); } public function __unset(string $key) : void { // unset this version and all previous versions $this->walk_versions( self::VERSION, fn($version) => parent::__unset($this->get_versioned_key($key, $version)), fn() => false ); } } ``` -------------------------------- ### Bulk Get Response (Error) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md Example JSON response structure indicating an error for a specific blob during a bulk get operation. The entry includes the blob name and an 'error' field. ```json [ { "blobName": "missing.txt", "error": "BlobNotFound" } ] ``` -------------------------------- ### Expected Output of Pub/Sub Quickstart Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md Observe the output to confirm that the checkout publisher is successfully publishing orders and the order-processor subscriber is receiving and processing them. This indicates the Pub/Sub pattern is working correctly. ```text == APP - checkout-sdk == Published data: Order { OrderId = 1 } == APP - order-processor == Subscriber received : Order { OrderId = 1 } == APP - checkout-sdk == Published data: Order { OrderId = 2 } == APP - order-processor == Subscriber received : Order { OrderId = 2 } == APP - checkout-sdk == Published data: Order { OrderId = 3 } == APP - order-processor == Subscriber received : Order { OrderId = 3 } == APP - checkout-sdk == Published data: Order { OrderId = 4 } == APP - order-processor == Subscriber received : Order { OrderId = 4 } == APP - checkout-sdk == Published data: Order { OrderId = 5 } == APP - order-processor == Subscriber received : Order { OrderId = 5 } == APP - checkout-sdk == Published data: Order { OrderId = 6 } == APP - order-processor == Subscriber received : Order { OrderId = 6 } == APP - checkout-sdk == Published data: Order { OrderId = 7 } == APP - order-processor == Subscriber received : Order { OrderId = 7 } == APP - checkout-sdk == Published data: Order { OrderId = 8 } == APP - order-processor == Subscriber received : Order { OrderId = 8 } == APP - checkout-sdk == Published data: Order { OrderId = 9 } == APP - order-processor == Subscriber received : Order { OrderId = 9 } == APP - checkout-sdk == Published data: Order { OrderId = 10 } == APP - order-processor == Subscriber received : Order { OrderId = 10 } Exited App successfully ``` -------------------------------- ### Dapr Go SDK Workflow and Activity Example Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/go/content/en/go-sdk-docs/go-client/_index.md Demonstrates how to define, register, and run Dapr Workflows and Activities using the Go SDK. This includes setting up a workflow worker, registering workflow and activity functions, and starting a workflow client to schedule and monitor a workflow execution. ```go import ( ... "github.com/dapr/go-sdk/workflow" ... ) func ExampleWorkflow(ctx *workflow.WorkflowContext) (any, error) { var output string input := "world" if err := ctx.CallActivity(ExampleActivity, workflow.ActivityInput(input)).Await(&output); err != nil { return nil, err } // Print output - "hello world" fmt.Println(output) return nil, nil } func ExampleActivity(ctx workflow.ActivityContext) (any, error) { var input int if err := ctx.GetInput(&input); err != nil { return "", err } return fmt.Sprintf("hello %s", input), nil } func main() { // Create a workflow worker w, err := workflow.NewWorker() if err != nil { log.Fatalf("error creating worker: %v", err) } // Register the workflow w.RegisterWorkflow(ExampleWorkflow) // Register the activity w.RegisterActivity(ExampleActivity) // Start workflow runner if err := w.Start(); err != nil { log.Fatal(err) } // Create a workflow client wfClient, err := workflow.NewClient() if err != nil { log.Fatal(err) } // Start a new workflow id, err := wfClient.ScheduleNewWorkflow(context.Background(), "ExampleWorkflow") if err != nil { log.Fatal(err) } // Wait for the workflow to complete metadata, err := wfClient.WaitForWorkflowCompletion(ctx, id) if err != nil { log.Fatal(err) } // Print workflow status post-completion fmt.Println(metadata.RuntimeStatus) // Shutdown Worker w.Shutdown() } ``` -------------------------------- ### Get Actor Reminder using cURL Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/api/actors_api.md Example of how to retrieve an actor reminder using cURL. ```shell curl http://localhost:3500/v1.0/actors/stormtrooper/50/reminders/checkRebels \ "Content-Type: application/json" ``` -------------------------------- ### Bulk Get Response (Streaming Mode) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/blobstorage.md Example JSON response structure when performing a bulk get operation in streaming mode, indicating the blob name and the local file path where it was saved. ```json [ { "blobName": "file1.txt", "filePath": "/tmp/file1.txt" }, { "blobName": "file2.txt", "filePath": "/tmp/file2.txt" } ] ``` -------------------------------- ### Navigate to Service Invocation Directory Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md Change directory to the specific service invocation quickstart folder. ```bash cd service_invocation/go/http ``` -------------------------------- ### HTTP Binding: Get Request (Specific Path) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/http.md Example of invoking the HTTP binding with a GET operation to request a specific path using curl. Supports both Windows and Linux command syntaxes. ```sh curl -d "{ \"operation\": \"get\", \"metadata\": { \"path\": \"/things/1234\" } }" \ http://localhost:/v1.0/bindings/ ``` ```sh curl -d '{ "operation": "get", "metadata": { "path": "/things/1234" } }' \ http://localhost:/v1.0/bindings/ ``` -------------------------------- ### Install Go SDK Source: https://github.com/dapr/docs/blob/v1.18/sdkdocs/pluggable-components/go/content/en/go-sdk-docs/_index.md Add the Dapr pluggable components Go SDK to your project dependencies. ```bash go get github.com/dapr-sandbox/components-go-sdk@v0.1.0 ``` -------------------------------- ### HTTP Binding: Get Request (Base URL) Source: https://github.com/dapr/docs/blob/v1.18/daprdocs/content/en/reference/components-reference/supported-bindings/http.md Example of invoking the HTTP binding with a GET operation to request the base URL using curl. Supports both Windows and Linux command syntaxes. ```bash curl -d "{ \"operation\": \"get\" }" \ http://localhost:/v1.0/bindings/ ``` ```bash curl -d '{ "operation": "get" }' \ http://localhost:/v1.0/bindings/ ```