### Build Getting Started Example Source: https://github.com/apache/opendal/blob/main/examples/cpp/CMakeLists.txt Defines an executable for the getting started example and links it with the OpenDAL C++ library. Includes necessary directories. ```cmake add_executable(getting-started getting_started.cpp) target_link_libraries(getting-started opendal_cpp) include_directories(getting-started opendal_cpp) ``` -------------------------------- ### Example Executable: Getting Started Source: https://github.com/apache/opendal/blob/main/bindings/c/CMakeLists.txt Builds an executable for the 'getting-started.c' example, linking against the OpenDAL C shared library. ```cmake add_executable(getting_started examples/getting-started.c) target_link_libraries(getting_started opendal_c_shared) ``` -------------------------------- ### Setup and Run Benchmark Tests Source: https://github.com/apache/opendal/blob/main/core/CONTRIBUTING.md Prepare the environment by copying the example .env file and then run the benchmark tests to measure operation performance. ```shell # Setup env cp .env.example .env # Run benches cargo bench ``` -------------------------------- ### Java Quickstart Example Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/java/02-getting-started.md This example demonstrates building an operator, writing a file, reading it back, inspecting metadata, and deleting it using the in-memory service. Ensure the operator is closed after use, preferably with a try-with-resources block. ```java ```java file=bindings/java/src/test/java/org/apache/opendal/examples/Main.java region=quickstart ``` ``` -------------------------------- ### Setup Virtual Environment and Dependencies Source: https://github.com/apache/opendal/blob/main/bindings/python/CONTRIBUTING.md Use the 'just setup' command to create a Python virtual environment and install all necessary dependencies. ```shell just setup ``` -------------------------------- ### OpenDAL Lua Quickstart Example Source: https://github.com/apache/opendal/blob/main/bindings/lua/README.md A basic example demonstrating how to initialize an OpenDAL operator for the local filesystem, write to a file, and read from it. Errors are handled using pcall. ```lua local opendal = require("opendal") -- Errors are raised as Lua errors; use pcall to catch them. local ok, op = pcall(opendal.operator.new, "fs", { root = "/tmp" }) if not ok then print(op) return end op:write("test.txt", "hello world") print("read:", op:read("test.txt")) -- "hello world" ``` -------------------------------- ### Setup and Run Behavior Tests Source: https://github.com/apache/opendal/blob/main/core/CONTRIBUTING.md Prepare the environment by copying the example .env file and then run the behavior tests to ensure service correctness. ```shell # Setup env cp .env.example .env # Run tests cargo test ``` -------------------------------- ### OpenDAL Node.js Quickstart Source: https://github.com/apache/opendal/blob/main/bindings/nodejs/README.md Initialize an operator for the local filesystem, write data to a file, read the data, and get file metadata. This example demonstrates basic file operations. ```javascript import { Operator } from "opendal"; async function main() { const op = new Operator("fs", { root: "/tmp" }); await op.write("test", "Hello, World!"); const bs = await op.read("test"); console.log(new TextDecoder().decode(bs)); const meta = await op.stat("test"); console.log(`contentLength: ${meta.contentLength}`); } main(); ``` -------------------------------- ### OpenDAL Java Quickstart Example Source: https://github.com/apache/opendal/blob/main/bindings/java/README.md Demonstrates basic file operations using the AsyncOperator for asynchronous calls. Ensure the 'fs' service is configured with a root path. ```java import java.util.HashMap; import java.util.Map; import org.apache.opendal.AsyncOperator; public class Main { public static void main(String[] args) { final Map conf = new HashMap<>(); conf.put("root", "/tmp"); try (AsyncOperator op = AsyncOperator.of("fs", conf)) { op.write("/path/to/data", "Hello world").join(); System.out.println(new String(op.read("/path/to/data").join())); } } } ``` -------------------------------- ### Quickstart: In-memory operator example Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/haskell/02-getting-started.md Demonstrates creating an in-memory operator, writing, reading, checking existence, inspecting metadata, and deleting a key. ```haskell ```haskell file=bindings/haskell/examples/GettingStarted.hs region=quickstart ``` ``` -------------------------------- ### Quickstart: File System Operations Source: https://github.com/apache/opendal/blob/main/bindings/python/README.md Configure and use the operator for local file system operations. Demonstrates writing, reading, and getting file metadata. ```python import opendal # Configure a service, then build an operator from it. op = opendal.Operator("fs", root="/tmp") # The same verbs work on every service. op.write("test.txt", b"Hello World") print(op.read("test.txt")) print(op.stat("test.txt").content_length) ``` -------------------------------- ### OpenDAL Haskell Quickstart Example Source: https://github.com/apache/opendal/blob/main/bindings/haskell/README.md A basic example demonstrating the usage of OpenDAL in Haskell. It initializes a memory backend, writes, reads, and deletes a file, then prints the content or error. ```haskell import OpenDAL main :: IO () main = do Right op <- newOperator "memory" result <- runOp op $ do writeOp "hello.txt" "Hello, World!" content <- readOp "hello.txt" deleteOp "hello.txt" return content case result of Left err -> putStrLn $ "error: " ++ show (errorCode err) Right bytes -> print bytes ``` -------------------------------- ### Setup GHC and Cabal versions Source: https://github.com/apache/opendal/blob/main/bindings/haskell/CONTRIBUTING.md Installs and sets the GHC compiler to version 9.4.8 and the Cabal build tool. Updates the Cabal package index after installation. ```bash ghcup install ghc 9.4.8 --set ghcup install cabal --set cabal update ``` -------------------------------- ### Install OpenDAL Go Bindings and Memory Service Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/go/02-getting-started.md Install the latest OpenDAL Go bindings and the memory service package using go get. ```shell go get github.com/apache/opendal/bindings/go@latest go get github.com/apache/opendal-go-services/memory ``` -------------------------------- ### Build and Run C++ Examples Source: https://github.com/apache/opendal/blob/main/examples/cpp/README.md Instructions for building and running the C++ examples using CMake and Make. ```bash mkdir build cd build cmake .. make ./basic-example ``` -------------------------------- ### Create and Run unftp Server with OpenDAL Backend Source: https://github.com/apache/opendal/blob/main/integrations/unftp-sbe/README.md This example demonstrates how to create an OpenDAL Operator for S3, wrap it with `OpendalStorage`, and then use it to build and start an unftp server. Ensure you have the necessary dependencies and configure your S3 credentials and endpoint correctly. ```rust use anyhow::Result; use opendal::Operator; use opendal::services; use unftp_sbe_opendal::OpendalStorage; #[tokio::main] async fn main() -> Result<()> { // Create any service desired let op = opendal::Operator::from_map::( [ ("bucket".to_string(), "my_bucket".to_string()), ("access_key".to_string(), "my_access_key".to_string()), ("secret_key".to_string(), "my_secret_key".to_string()), ("endpoint".to_string(), "my_endpoint".to_string()), ("region".to_string(), "my_region".to_string()), ] .into_iter() .collect(), )?.finish(); // Wrap the operator with `OpendalStorage` let backend = OpendalStorage::new(op); // Build the actual unftp server let server = libunftp::ServerBuilder::new(Box::new(move || backend.clone())).build()?; // Start the server server.listen("0.0.0.0:0").await?; Ok(()) } ``` -------------------------------- ### Install Project for Development Source: https://github.com/apache/opendal/blob/main/bindings/python/CONTRIBUTING.md Build and install the package in the current virtual environment for immediate use in testing. ```shell just install-dev ``` -------------------------------- ### Build and Install with cargo-php Source: https://github.com/apache/opendal/blob/main/bindings/php/README.md Use cargo-php to streamline the build and installation process. ```bash cargo install cargo-php cargo php install ``` -------------------------------- ### Install Go Service Package Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/go/01-overview.md Install a companion module for a specific service, such as the in-memory service. Each service has its own module. ```shell go get github.com/apache/opendal-go-services/memory ``` -------------------------------- ### Build and Install with cargo-php Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/php/01-overview.md Use cargo-php to build and install the extension in a single step. ```bash cargo install cargo-php cd opendal/bindings/php cargo php install ``` -------------------------------- ### Build Basic Example Source: https://github.com/apache/opendal/blob/main/examples/cpp/CMakeLists.txt Defines an executable for the basic example and links it with the OpenDAL C++ library. Includes necessary directories. ```cmake add_executable(basic-example basic.cpp) target_link_libraries(basic-example opendal_cpp) include_directories(basic-example opendal_cpp) ``` -------------------------------- ### Example Executable: Basic Usage Source: https://github.com/apache/opendal/blob/main/bindings/c/CMakeLists.txt Builds an executable for the 'basic.c' example, linking against the OpenDAL C shared library. ```cmake # example targets add_executable(basic examples/basic.c) target_link_libraries(basic opendal_c_shared) ``` -------------------------------- ### Install Rustup for Linux/macOS Source: https://github.com/apache/opendal/blob/main/CONTRIBUTING.md Use this command to install rustup, the Rust toolchain installer, on Linux or macOS systems. It is the recommended way to set up the Rust development environment. ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Install OpenDAL Go Binding Source: https://github.com/apache/opendal/blob/main/bindings/go/README.md Install the latest version of the opendal-go binding. Ensure libffi is installed on your system. ```bash go get github.com/apache/opendal/bindings/go@latest ``` -------------------------------- ### Install Dependencies and Build Project Source: https://github.com/apache/opendal/blob/main/bindings/nodejs/CONTRIBUTING.md Installs project dependencies using pnpm and builds the project from source. ```shell # Install dependencies. > pnpm install # Build from source. > pnpm build ``` -------------------------------- ### Start Local Development Server Source: https://github.com/apache/opendal/blob/main/website/README.md Starts a local development server for the website. Changes are reflected live without requiring a server restart. ```bash pnpm start ``` -------------------------------- ### Install Gem Dependencies Source: https://github.com/apache/opendal/blob/main/bindings/ruby/CONTRIBUTING.md Installs the necessary gem and its dependencies using Bundler. This is a prerequisite for development. ```shell bundle ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/apache/opendal/blob/main/website/README.md Installs project dependencies using pnpm. This is typically the first step before running any other commands. ```bash pnpm install ``` -------------------------------- ### Start Local Blob Service with Docker and Azurite Source: https://github.com/apache/opendal/blob/main/core/services/azblob/src/docs.md Instructions for starting a local Azure Blob Storage emulator using Docker and Azurite, including container creation. ```shell docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite az storage container create --name test --connection-string "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;" ``` -------------------------------- ### Install oay Gateway via Package Managers Source: https://github.com/apache/opendal/blob/main/core/core/src/docs/rfcs/0443_gateway.md Alternative installation methods for the 'oay' Gateway binary using common package managers for different operating systems. ```shell # Archlinux Pacman -S oay ``` ```shell # Debian / Ubuntu apt install oay ``` ```shell # Rocky Linux / Fedora dnf install oay ``` ```shell # macOS brew install oay ``` -------------------------------- ### Run Concurrent Upload Example Source: https://github.com/apache/opendal/blob/main/core/examples/concurrent-upload/README.md Execute the concurrent upload example by setting the OPENDAL_TEST environment variable to control the target storage service. ```shell OPENDAL_TEST=s3 cargo run ``` -------------------------------- ### Run Bundled OpenDAL Lua Example Source: https://github.com/apache/opendal/blob/main/bindings/lua/README.md Executes the bundled example script for the OpenDAL Lua binding using the lua5.2 interpreter. ```bash lua5.2 example/fs.lua ``` -------------------------------- ### Install optional dev tools Source: https://github.com/apache/opendal/blob/main/bindings/ocaml/README.md Installs recommended development tools for OCaml, including utop, odoc, ounit2, ocaml-lsp-server, ocamlformat, and ocamlformat-rpc. ```bash opam install -y utop odoc ounit2 ocaml-lsp-server ocamlformat ocamlformat-rpc ``` -------------------------------- ### Install Build Tools on Ubuntu/Debian Source: https://github.com/apache/opendal/blob/main/bindings/cpp/CONTRIBUTING.md Installs necessary C/C++ toolchain, CMake, Ninja, clang-format, Doxygen, and Graphviz for building and documentation on Ubuntu and Debian-based systems. ```shell # install C/C++ toolchain (can be replaced by other toolchains) sudo apt install build-essential # install CMake and Ninja sudo apt install cmake ninja-build # install clang-format sudo apt install clang-format # install Doxygen and Graphviz sudo apt install doxygen graphviz ``` -------------------------------- ### Install Swift Binding via Local Path Source: https://github.com/apache/opendal/blob/main/bindings/swift/README.md Reference the Swift binding by its local path in your project's Package.swift file for installation. ```swift // swift-tools-version:5.7 import PackageDescription let package = Package( name: "MyTool", dependencies: [ .package(path: "/path/to/opendal/bindings/swift/OpenDAL"), ], targets: [ .target(name: "MyTool", dependencies: [ .product(name: "OpenDAL", package: "OpenDAL"), ]), ] ) ``` -------------------------------- ### Quickstart: Basic File Operations Source: https://github.com/apache/opendal/blob/main/bindings/go/README.md Demonstrates creating an operator, writing to a file, and reading from it using the in-memory service. Ensure the necessary service module is imported. ```go package main import ( "fmt" "log" "github.com/apache/opendal-go-services/memory" opendal "github.com/apache/opendal/bindings/go" ) func main() { op, err := opendal.NewOperator(memory.Scheme, opendal.OperatorOptions{}) if err != nil { log.Fatal(err) } defer op.Close() if err := op.Write("hello.txt", []byte("Hello, OpenDAL!")); err != nil { log.Fatal(err) } data, err := op.Read("hello.txt") if err != nil { log.Fatal(err) } fmt.Printf("Read content: %s\n", data) } ``` -------------------------------- ### macOS Specific Linking Source: https://github.com/apache/opendal/blob/main/examples/cpp/CMakeLists.txt Conditionally links framework libraries for macOS to support the basic and getting started examples. ```cmake if(APPLE) target_link_libraries(basic-example "-framework CoreFoundation -framework Security") target_link_libraries(getting-started "-framework CoreFoundation -framework Security") endif() ``` -------------------------------- ### Verify GHC and Cabal Installation Source: https://github.com/apache/opendal/blob/main/bindings/haskell/CONTRIBUTING.md Checks the installed versions of the GHC compiler and Cabal build tool. This is a verification step after setup. ```bash > ghc -V The Glorious Glasgow Haskell Compilation System, version 9.4.8 > cabal -V cabal-install version 3.6.2.0 compiled using version 3.6.2.0 of the Cabal library ``` -------------------------------- ### Quickstart: Basic Memory Backend Operations Source: https://github.com/apache/opendal/blob/main/bindings/dotnet/README.md Demonstrates basic file operations (write, read, stat) using the memory backend. Imports OpenDAL and System.Text. ```csharp using OpenDAL; using System.Text; // Configure a service, then build an operator from it. using var op = new Operator("memory"); // The same verbs work on every service. op.Write("hello.txt", Encoding.UTF8.GetBytes("Hello, World!")); var bytes = op.Read("hello.txt"); Console.WriteLine(Encoding.UTF8.GetString(bytes)); Console.WriteLine(op.Stat("hello.txt").ContentLength); ``` -------------------------------- ### S3 Get Object Call Example Source: https://github.com/apache/opendal/blob/main/core/core/src/docs/rfcs/7660_move_read_range_to_reader.md Illustrates how the S3 get object call is adapted to use the new range parameter directly from the reader's arguments. ```rust let resp = self.core.s3_get_object(path, args.range(), &args).await?; ``` -------------------------------- ### Basic AliyunDrive Setup in Rust Source: https://github.com/apache/opendal/blob/main/core/services/aliyun-drive/src/docs.md Demonstrates how to initialize the AliyunDrive backend with necessary credentials and configuration. Ensure all required fields like client_id, client_secret, refresh_token, and drive_type are provided. ```rust use opendal_core::Operator; use opendal_core::Result; use opendal_service_aliyun_drive::AliyunDrive; #[tokio::main] async fn main() -> Result<()> { // Create aliyun-drive backend builder. let mut builder = AliyunDrive::default() // Set the root for aliyun-drive, all operations will happen under this root. // // NOTE: the root must be absolute path. .root("/path/to/dir") // Set the client_id. This is required. .client_id("client_id") // Set the client_secret. This is required. .client_secret("client_secret") // Set the refresh_token. This is required. .refresh_token("refresh_token") // Set the drive_type. This is required. // // Fallback to the default type if no other types found. .drive_type("resource"); let op: Operator = Operator::new(builder)?; Ok(()) } ``` -------------------------------- ### Get Current Version ID of a File Source: https://github.com/apache/opendal/blob/main/core/core/src/docs/rfcs/2602_object_versioning.md Retrieves the metadata of a file to access its current version ID. This is a basic example to show how to get the version ID from metadata. ```rust let meta = op.stat("path/to/file").await?; let version_id = meta.version().expect("just for example"); ``` -------------------------------- ### Quickstart: Local filesystem operations Source: https://github.com/apache/opendal/blob/main/bindings/ocaml/README.md Demonstrates creating an operator for the local filesystem, writing a file, and reading it back. Handles potential errors from operator creation and file operations. ```ocaml open Opendal (* Create an operator for the local filesystem *) let () = match Operator.new_operator "fs" [ ("root", "/tmp") ] with | Error err -> Printf.eprintf "Error: %s\n" err | Ok op -> (* Write a file *) ignore (Operator.write op "hello.txt" (Bytes.of_string "Hello, World!")); (* Read it back *) (match Operator.read op "hello.txt" with | Ok content -> let text = content |> Array.to_seq |> Bytes.of_seq |> Bytes.to_string in print_endline text (* Hello, World! *) | Error err -> Printf.eprintf "Error: %s\n" err) ``` -------------------------------- ### OpenDAL Ruby Quickstart with Memory Backend Source: https://github.com/apache/opendal/blob/main/bindings/ruby/README.md Demonstrates basic operations like writing, reading, listing, and deleting objects using the memory backend. ```ruby require "opendal" op = OpenDal::Operator.new("memory", {}) op.write("hello.txt", "Hello, World!") puts op.read("hello.txt") # => "Hello, World!" op.list("").each do |entry| puts entry.path end op.delete("hello.txt") ``` -------------------------------- ### Add S3 Scheme Package Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/go/03-connecting.md Install the S3 scheme package using go get. Import the package to access its Scheme value. ```shell go get github.com/apache/opendal-go-services/s3 ``` -------------------------------- ### Quickstart: Initialize Storage and File Operations Source: https://github.com/apache/opendal/blob/main/bindings/dart/README.md Demonstrates initializing storage with a 'memory' scheme and performing basic file operations like writing, reading, and deleting. The API mirrors dart:io's File operations. ```dart import 'dart:typed_data'; import 'package:opendal/opendal.dart'; void main() async { final storage = await Storage.init(schemeStr: "memory", map: {"root": "/"}); final File = storage.initFile(); final file = File("hello.txt"); await file.write(Uint8List.fromList("Hello, OpenDAL!".codeUnits)); final data = await file.read(); print(String.fromCharCodes(data)); // Hello, OpenDAL! await file.delete(); } ``` -------------------------------- ### OpenDAL Quickstart with In-Memory Service Source: https://github.com/apache/opendal/blob/main/core/README.md Demonstrates basic file operations like write, read, stat, and delete using OpenDAL's in-memory service. Ensure tokio is enabled for async operations. ```rust use opendal::services; use opendal::Operator; use opendal::Result; #[tokio::main] async fn main() -> Result<()> { // Configure a service, then build an operator from it. let op = Operator::new(services::Memory::default())?; // The same verbs work on every service. op.write("hello.txt", "Hello, World!").await?; let bytes = op.read("hello.txt").await?; let meta = op.stat("hello.txt").await?; op.delete("hello.txt").await?; println!("read {} bytes", meta.content_length()); Ok(()) } ``` -------------------------------- ### Install GHCup for Haskell Source: https://github.com/apache/opendal/blob/main/bindings/haskell/CONTRIBUTING.md Installs the GHCup toolchain manager for Haskell on Unix-like systems. Use this to manage Haskell compiler and cabal installations. ```bash curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh ``` -------------------------------- ### Quickstart: Basic File Operations Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/php/02-getting-started.md This snippet demonstrates the fundamental file operations: writing, reading, inspecting metadata, and deleting a file using an in-memory operator. ```php use OpenDAL\Operator; // Construct an operator for the in-memory service. $op = new Operator("memory"); // Write content to a file. $op->write("hello.txt", "Hello, OpenDAL!"); // Read content from the file. echo $op->read("hello.txt"); // Get file metadata. $meta = $op->stat("hello.txt"); echo "Content Length: " . $meta->content_length . "\n"; // Check if the file exists. if ($op->is_exist("hello.txt")) { echo "hello.txt exists.\n"; } // Delete the file. $op->delete("hello.txt"); // Verify deletion. if (!$op->is_exist("hello.txt")) { echo "hello.txt deleted successfully.\n"; } ``` -------------------------------- ### Install GnuPG Source: https://github.com/apache/opendal/blob/main/website/community/release/verify.md Install GnuPG using Homebrew to manage cryptographic keys. ```shell brew install gnupg ``` -------------------------------- ### Write to Filesystem Backend Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/d/02-getting-started.md Configure and use the filesystem backend to write a file. Ensure the backend is enabled during build time. ```d import opendal; void main() @safe { auto options = new OperatorOptions(); options.set("root", "/tmp/mydata"); auto op = Operator("fs", options); op.write("hello.txt", cast(ubyte[]) "Hello from the filesystem!".dup); } ``` -------------------------------- ### Build Documentation Theme and Docs Source: https://github.com/apache/opendal/blob/main/bindings/nodejs/CONTRIBUTING.md Commands to build the documentation theme once and then build the documentation locally. ```shell # Only needed once, unless you want to update the docs theme. pnpm run build:theme # Build the docs. pnpm run docs ``` -------------------------------- ### Install OpenDAL Node.js Binding Source: https://github.com/apache/opendal/blob/main/bindings/nodejs/README.md Install the opendal package using npm. ```shell npm install opendal ``` -------------------------------- ### Setup for Full Disk Write Test Source: https://github.com/apache/opendal/blob/main/core/edge/file_write_on_full_disk/README.md Prepare a disk image and mount it to simulate a full disk environment for testing file write operations. ```shell fallocate -l 512K disk.img mkfs disk.img mkdir ./td sudo mount -o loop td.img ./td chmod a+wr ./td ``` -------------------------------- ### Install OpenDAL and Polars Source: https://github.com/apache/opendal/blob/main/bindings/python/docs/examples/polars.ipynb Install the necessary libraries for OpenDAL and Polars integration. ```python # Install the opendal and polars !pip install opendal, polars ``` -------------------------------- ### Initialize OSS Backend via Builder Source: https://github.com/apache/opendal/blob/main/core/services/oss/src/docs.md Demonstrates how to create and configure an OSS backend using the OpenDAL builder pattern. Ensure all required fields like root, bucket, and endpoint are set. Credentials can be loaded from the environment or provided directly. ```rust use opendal_core::Operator; use opendal_core::Result; use opendal_service_oss::Oss; #[tokio::main] async fn main() -> Result<()> { // Create OSS backend builder. let mut builder = Oss::default() // Set the root for oss, all operations will happen under this root. // // NOTE: the root must be absolute path. .root("/path/to/dir") // Set the bucket name, this is required. .bucket("test") // Set the endpoint. // // For example: // - "https://oss-ap-northeast-1.aliyuncs.com" // - "https://oss-hangzhou.aliyuncs.com" .endpoint("https://oss-cn-beijing.aliyuncs.com") // Set the access_key_id and access_key_secret. // // OpenDAL will try load credential from the env. // If credential not set and no valid credential in env, OpenDAL will // send request without signing like anonymous user. .access_key_id("access_key_id") .access_key_secret("access_key_secret"); let op: Operator = Operator::new(builder)?; Ok(()) } ``` -------------------------------- ### Basic File Operations with Memory Backend Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/d/02-getting-started.md Demonstrates creating an Operator for the in-memory backend, writing a file, reading it back, checking existence, inspecting metadata, and deleting it. ```d import opendal; import std.stdio : writeln; void main() @safe { auto options = new OperatorOptions(); auto op = Operator("memory", options); op.createDir("logs/"); op.write("logs/a.txt", cast(ubyte[]) "first".dup); op.write("logs/b.txt", cast(ubyte[]) "second".dup); Entry[] entries = op.list("logs/"); foreach (e; entries) writeln(e.path(), " name=", e.name()); } ``` -------------------------------- ### Install opam Source: https://github.com/apache/opendal/blob/main/bindings/ocaml/README.md Instructions for installing opam package manager on different operating systems. ```bash bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)" ``` ```bash brew install opam ``` ```bash apt-get install opam ``` ```bash pacman -S opam ``` -------------------------------- ### Install OpenDAL Python Binding Source: https://github.com/apache/opendal/blob/main/bindings/python/README.md Install the OpenDAL Python package using pip. ```bash pip install opendal ``` -------------------------------- ### Initialize and Use S3 Service with OpenDAL Source: https://github.com/apache/opendal/blob/main/website/blog/2024-01-22-apache-opendal-graduated/index.md Demonstrates initializing an S3 service, configuring it, and performing basic operations like writing, reading, and deleting files using OpenDAL. Includes adding a logging layer for observability. ```rust async fn main() -> Result<()> { // Init s3 service. let mut builder = services::S3::default(); builder.bucket("test"); // Init an operator let op = Operator::via_map(builder)? // Add logging .layer(LoggingLayer::default()) .finish(); // Write data op.write("hello.txt", "Hello, World!").await?; // Read data let bs = op.read("hello.txt").await?; // Fetch metadata let meta = op.stat("hello.txt").await?; let mode = meta.mode(); let length = meta.content_length(); // Delete op.delete("hello.txt").await?; Ok(()) } ``` -------------------------------- ### Install OpenDAL and Pandas Source: https://github.com/apache/opendal/blob/main/bindings/python/docs/examples/pandas.ipynb Install the necessary libraries, opendal and pandas, using pip. ```python # Install the opendal and pandas !pip install opendal, pandas ``` -------------------------------- ### Install wasm-pack Source: https://github.com/apache/opendal/blob/main/core/edge/s3_read_on_wasm/README.md Install the wasm-pack tool, which is required for building and testing Rust code for WebAssembly. ```shell cargo install wasm-pack ``` -------------------------------- ### Build and Serve for Content Search Testing Source: https://github.com/apache/opendal/blob/main/website/README.md Builds the website and serves it locally for testing content search functionality, as the search plugin does not work with 'pnpm start'. ```bash pnpm build && pnpm serve ``` -------------------------------- ### Install OpenDAL Ruby Gem Source: https://github.com/apache/opendal/blob/main/bindings/ruby/README.md Install the OpenDAL Ruby gem using the RubyGems package manager. ```shell gem install opendal ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/apache/opendal/blob/main/bindings/python/CONTRIBUTING.md Clone the OpenDAL repository and navigate to the Python bindings directory to begin setup. ```shell git clone git@github.com:apache/opendal.git cd opendal/bindings/python ``` -------------------------------- ### Initialize Swift Backend via Builder Source: https://github.com/apache/opendal/blob/main/core/services/swift/src/docs.md Demonstrates how to initialize the Swift backend using the builder pattern. Set the root path, endpoint, container, and token for authentication. ```rust use opendal_core::Operator; use opendal_core::Result; use opendal_service_swift::Swift; #[tokio::main] async fn main() -> Result<()> { // Create Swift backend builder let mut builder = Swift::default() // Set the root for swift, all operations will happen under this root .root("/path/to/dir") // set the endpoint of Swift backend .endpoint("https://openstack-controller.example.com:8080/v1/account") // set the container name of Swift workspace .container("container") // set the auth token for builder .token("token"); let op: Operator = Operator::new(builder)?; Ok(()) } ``` -------------------------------- ### Install Dependencies for Running Tests Source: https://github.com/apache/opendal/blob/main/bindings/php/README.md Install Composer dependencies required for running the extension's tests. ```bash cd opendal/bindings/php composer install composer test ``` -------------------------------- ### Install OpenDAL Source: https://github.com/apache/opendal/blob/main/bindings/python/docs/examples/basic.ipynb Install the opendal package using pip. This is a prerequisite for using OpenDAL in your Python environment. ```python # Install the opendal !pip install opendal ``` -------------------------------- ### Quickstart: In-Memory Service Operations Source: https://github.com/apache/opendal/blob/main/bindings/swift/README.md Create an operator using the in-memory service, write data to a path, and read it back. Handles OperatorError on failure. ```swift import OpenDAL // Create an operator backed by the in-memory service. let op = try Operator(scheme: "memory") // Write bytes to a path. var data = Data([1, 2, 3, 4]) try op.blockingWrite(&data, to: "/demo") // Read them back. let result = try op.blockingRead("/demo") print(result) ``` -------------------------------- ### Basic S3 Setup with OpenDAL Source: https://github.com/apache/opendal/blob/main/core/services/s3/src/docs.md Configure a basic S3 backend using the Builder pattern. Ensure all required fields like root, bucket, region, and endpoint are set. Credentials can be loaded from the environment or provided directly. ```rust use opendal_core::Operator; use opendal_core::Result; use opendal_service_s3::S3; #[tokio::main] async fn main() -> Result<()> { // Create s3 backend builder. let mut builder = S3::default() // Set the root for s3, all operations will happen under this root. // // NOTE: the root must be absolute path. .root("/path/to/dir") // Set the bucket name. This is required. .bucket("test") // Set the region. This is required for some services, if you don't care about it, for example Minio service, just set it to "auto", it will be ignored. .region("us-east-1") // Set the endpoint. // // For examples: // - "https://s3.amazonaws.com" // - "http://127.0.0.1:9000" // - "https://oss-ap-northeast-1.aliyuncs.com" // - "https://cos.ap-seoul.myqcloud.com" // // Default to "https://s3.amazonaws.com" .endpoint("https://s3.amazonaws.com") // Set the access_key_id and secret_access_key. // // OpenDAL will try load credential from the env. // If credential not set and no valid credential in env, OpenDAL will // send request without signing like anonymous user. .access_key_id("access_key_id") .secret_access_key("secret_access_key"); let op: Operator = Operator::new(builder)?; Ok(()) } ``` -------------------------------- ### Start Vote Email Title Source: https://github.com/apache/opendal/blob/main/website/community/pmc_members/nominate-pmc-member.md Use this title when starting a vote for a new PMC member candidate. ```text [VOTE] Add candidate ${candidate_name} as a new PMC member ``` -------------------------------- ### Basic OpenDAL Operations with Memory Service Source: https://github.com/apache/opendal/blob/main/website/docs/20-bindings/go/02-getting-started.md This example demonstrates building an operator, writing a file, reading it back, inspecting metadata, and deleting it using the in-memory service. ```go package main import ( "fmt" "log" "github.com/apache/opendal/bindings/go" "github.com/apache/opendal-go-services/memory" ) func main() { op, err := opendal.NewOperator(memory.Scheme) if err != nil { log.Fatalf("operator init failed: %v", err) } defer op.Close() // Write a file content := []byte("Hello, OpenDAL!") if err := op.Write("hello.txt", content); err != nil { log.Fatalf("write failed: %v", err) } // Read a file data, err := op.Read("hello.txt") if err != nil { log.Fatalf("read failed: %v", err) } if string(data) != string(content) { log.Fatalf("content mismatch: expected %q, got %q", content, data) } // Stat a file meta, err := op.Stat("hello.txt") if err != nil { log.Fatalf("stat failed: %v", err) } fmt.Printf("File size: %d bytes\n", meta.Size()) // Delete a file if err := op.Delete("hello.txt"); err != nil { log.Fatalf("delete failed: %v", err) } } ``` -------------------------------- ### Initialize Dropbox Service via Builder Source: https://github.com/apache/opendal/blob/main/core/services/dropbox/src/docs.md Demonstrates how to initialize the Dropbox service using its builder with an access token. Ensure the token is valid and has the necessary permissions. ```rust use opendal_core::Operator; use opendal_core::Result; use opendal_service_dropbox::Dropbox; #[tokio::main] async fn main() -> Result<()> { let mut builder = Dropbox::default() .root("/opendal") .access_token(""); let op: Operator = Operator::new(builder)?; Ok(()) } ``` -------------------------------- ### Install OrbStack on MacOS Source: https://github.com/apache/opendal/blob/main/core/tests/behavior/README.md Use this command to install OrbStack on MacOS, which is recommended for Docker compatibility with behavior tests. ```shell brew install orbstack ``` -------------------------------- ### Install GPG with apt Source: https://github.com/apache/opendal/blob/main/website/community/release/reference/setup_gpg.md Installs the gnupg2 package using apt. This is a prerequisite for generating and managing GPG keys. ```shell sudo apt install gnupg2 ``` -------------------------------- ### Example Checksum and Signature File Paths Source: https://github.com/apache/opendal/blob/main/website/community/release/verify.md Illustrates the expected naming convention and location for checksum (.sha512) and signature (.asc) files within a release candidate directory. ```text https://dist.apache.org/repos/dist/dev/opendal/0.55.0-rc.1/apache-opendal-core-0.55.0-src.tar.gz.sha512 https://dist.apache.org/repos/dist/dev/opendal/0.55.0-rc.1/apache-opendal-core-0.55.0-src.tar.gz.asc https://dist.apache.org/repos/dist/dev/opendal/0.55.0-rc.1/apache-opendal-bindings-java-0.48.2-src.tar.gz.sha512 https://dist.apache.org/repos/dist/dev/opendal/0.55.0-rc.1/apache-opendal-bindings-java-0.48.2-src.tar.gz.asc ```