pub struct OriginImportArgs {Show 14 fields
pub input: PathBuf,
pub to: Option<PathBuf>,
pub move_source: bool,
pub bundle: Option<PathBuf>,
pub force: bool,
pub follow_symlinks: bool,
pub exclude: Vec<String>,
pub subfolder: Option<String>,
pub json: bool,
pub optimize: bool,
pub chunk_avg: Option<u64>,
pub chunk_min: Option<u64>,
pub chunk_max: Option<u64>,
pub dry_run: bool,
}Expand description
decdn origin import — seed a cache origin store from a local file or tree.
Fields§
§input: PathBufLocal file or directory to import. A directory is walked recursively
(see --follow-symlinks / --exclude); every regular file becomes a
content-addressed blob in the target.
to: Option<PathBuf>Directory to populate — a local filesystem origin store rooted here,
created if absent. This is the only write backend; pass the path
directly (--to /var/lib/decdn/origin), with no scheme prefix.
To populate an S3 origin, import to a local directory and then
aws s3 sync <dir> s3://<bucket>/<prefix>: the fs and S3 object layouts
are byte-identical, so the sync needs no renaming. An s3:// or
http(s):// value is rejected with that recipe rather than treated as a
path.
Required unless --dry-run.
A PathBuf, not a String, so a non-UTF-8 directory path is accepted
on Unix like --input is. Prefix sniffing (s3:// / http(s):// /
fs:) runs on the UTF-8 view; a non-UTF-8 path cannot be one of those,
so it is unambiguously a filesystem directory.
move_source: boolMove each source file into the target instead of copying it. Across filesystems this falls back to copy-then-unlink. A source whose content is already present in the target is removed too (the blob is there).
bundle: Option<PathBuf>When importing a directory, also write the canonical bundle manifest to this file (in addition to importing the manifest blob into the target). Ignored for a single-file import.
force: boolOverwrite a target object even when one already exists at its hash. By
default an existing object is left in place (content-addressed: the same
hash is the same bytes); a size mismatch is refused unless --force.
follow_symlinks: boolFollow symlinks during a directory walk. Off by default. Even when on, a symlink resolving outside the input root is a hard error: a manifest’s relative-path field cannot describe an external target.
exclude: Vec<String>Glob pattern of paths to exclude during a directory walk, matched against
the POSIX relative path (a/b.txt, never the absolute path). Repeatable
— every pattern is OR-ed together.
subfolder: Option<String>Prefix every manifest entry’s path with this folder, so a bundle pull
materializes the whole bundle under one directory (<out>/<subfolder>/…)
rather than spilling its files directly into the output root. Must be a
relative POSIX path with / separators — .., absolute paths, root
prefixes, and backslashes are rejected; nesting (a/b) is allowed.
Applies to a single-file import too (the one entry becomes
<subfolder>/<name>).
json: boolEmit a one-line JSON status report instead of a human summary. Written to
stdout normally; under --dry-run it goes to stderr, because stdout then
carries the canonical manifest bytes. origin is the --to target, or
the literal (dry-run) when a dry run runs without --to.
Shape:
{"imported":<n>,"bytes":<total>,"origin":"<target>","files":{"<path>":"b3:<hex>",...},"bundle_hash":"b3:<hex>"|null,"moved":<bool>,"optimized":<bool>,"chunks_total":<n>,"skipped_symlinks":<n>}.
optimize: boolContent-defined-chunk each file and record the chunk boundaries as
{hash,size} hints in the manifest entry; each file is still stored
as one whole-file blob. A pull uses the hints to splice ranges it
already holds instead of re-fetching them. Off by default (no hints).
chunk_avg: Option<u64>Target average chunk size (--optimize only). The primary dial. Must be
a power of two, at most 4 MiB (fastcdc’s ceiling). Defaults to 4 MiB when
--optimize is set (applied in the import wiring, not by clap, so an
explicit --chunk-avg without --optimize is a detectable error).
chunk_min: Option<u64>Minimum chunk size override (--optimize only). Defaults to avg/4.
At least 1 MiB (the payment interval), at most 1 MiB (fastcdc’s ceiling).
chunk_max: Option<u64>Maximum chunk size override (--optimize only). Defaults to 2*avg.
At most 16 MiB (fastcdc’s ceiling).
dry_run: boolCompute and emit the manifest without writing any blobs. Prints the
canonical manifest bytes to stdout (status goes to stderr). Makes --to
optional — this is the local “just make me a manifest” path.
Trait Implementations§
Source§impl Args for OriginImportArgs
impl Args for OriginImportArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Debug for OriginImportArgs
impl Debug for OriginImportArgs
Source§impl FromArgMatches for OriginImportArgs
impl FromArgMatches for OriginImportArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for OriginImportArgs
impl RefUnwindSafe for OriginImportArgs
impl Send for OriginImportArgs
impl Sync for OriginImportArgs
impl Unpin for OriginImportArgs
impl UnsafeUnpin for OriginImportArgs
impl UnwindSafe for OriginImportArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more