6 configuration options · available in Rust, Go
use opendal::Operator;
let operator = Operator::via_iter("git", [
("repository".to_string(), "https://huggingface.co/hf-internal-testing/tiny-random-bert".to_string()),
])?;
use opendal::Operator;
let operator = Operator::via_iter("git", [
// Git repository URL or local path.
//
// Examples:
//
// - `https://github.com/apache/opendal.git`
// - `https://huggingface.co/hf-internal-testing/tiny-random-bert`
// - `file:///path/to/repository.git`
//
// This is required.
("repository".to_string(), "https://huggingface.co/hf-internal-testing/tiny-random-bert".to_string()),
// Git reference to resolve.
//
// The value can be a branch, tag, commit hash, or `HEAD`. The reference is
// resolved once when the operator first accesses the repository. Later
// operations use the same immutable snapshot and do not refresh it.
//
// The default is `HEAD`.
// ("reference".to_string(), "HEAD".to_string()),
// Root path within the repository.
//
// All operations are relative to this path. The default is `/`.
// ("root".to_string(), "/".to_string()),
// Username used for the Git fetch and same-origin LFS requests.
//
// Credentials are not sent to a cross-origin LFS download action. This is
// optional.
// ("username".to_string(), "...".to_string()),
// Password or personal access token used for the Git fetch and
// same-origin LFS requests.
//
// Credentials are not sent to a cross-origin LFS download action. This is
// optional.
// ("password".to_string(), "...".to_string()),
// Whether to resolve Git LFS pointer files.
//
// When enabled, the service detects Git LFS pointers and streams the
// referenced object. When disabled, the pointer file itself is returned.
// The default is `true`.
// ("resolve_lfs".to_string(), "true".to_string()),
])?;
Every option is passed as a string key; OpenDAL parses it into the right type. Some services may require building the binding with the matching services-* feature enabled.
| Key | Type | Required | Description |
|---|---|---|---|
repositorye.g. https://huggingface.co/hf-internal-testing/tiny-random-bert | string | yes | Git repository URL or local path.
Examples:
- https://github.com/apache/opendal.git
- https://huggingface.co/hf-internal-testing/tiny-random-bert
- file:///path/to/repository.git
This is required. |
referencedefault HEAD | string | no | Git reference to resolve.
The value can be a branch, tag, commit hash, or HEAD. The reference is
resolved once when the operator first accesses the repository. Later
operations use the same immutable snapshot and do not refresh it.
The default is HEAD. |
rootdefault / | string | no | Root path within the repository.
All operations are relative to this path. The default is /. |
username | string | no | Username used for the Git fetch and same-origin LFS requests. Credentials are not sent to a cross-origin LFS download action. This is optional. |
password | string | no | Password or personal access token used for the Git fetch and same-origin LFS requests. Credentials are not sent to a cross-origin LFS download action. This is optional. |
resolve_lfsdefault true | bool | no | Whether to resolve Git LFS pointer files.
When enabled, the service detects Git LFS pointers and streams the
referenced object. When disabled, the pointer file itself is returned.
The default is true. |