Crate comprehensive_s3

Source
Expand description

comprehensive Resource generator for using S3 buckets

This crate provides a macro for declaring an S3 bucket as a comprehensive::Resource. It is a thin wrapper over the s3::Bucket type. When included in a comprehensive::Assembly it probes the bucket periodically as a health check signal.

// Defines a new type "SomeBucket" which is a Resource with
// display name "My storage". It installs command line flags
// beginning with "--app-data-" for specifying the bucket.
comprehensive_s3::bucket!(SomeBucket, "My storage", "app-data-");

// It can later be used as a dependency for another Resource:
#[derive(comprehensive::ResourceDependencies)]
struct OtherDependencies {
    bucket: std::sync::Arc<SomeBucket>,
}

§Command line flags for buckets

FlagDefaultMeaning
--PREFIXs3-endpointAutoEndpoint (usually https://…) If unset, s3::Region builtins will be used.
--PREFIXs3-region-nameRequiredRegion name as a string.
--PREFIXbucket-nameRequiredBucket name as a string.

Macros§

bucket
Defines a new type “SomeBucket” which is a Resource with display name “My storage”. It installs command line flags beginning with “–app-data-” for specifying the bucket.