pub enum Storage {
FileSystem {
path: PathBuf,
},
S3Compatible {
endpoint: String,
bucket: String,
},
Gcs {
endpoint: Option<String>,
bucket: String,
},
BigTable {
endpoint: Option<String>,
project_id: String,
instance_name: String,
table_name: String,
connections: Option<usize>,
},
}Expand description
Storage backend configuration.
The type field in YAML or __TYPE in environment variables determines which variant is used.
Used in: Config::high_volume_storage, Config::long_term_storage
Variants§
FileSystem
Local filesystem storage backend (type "filesystem").
Stores objects as files on the local filesystem. Suitable for development, testing, and single-server deployments.
§Example
long_term_storage:
type: filesystem
path: /dataFields
path: PathBufDirectory path for storing objects.
The directory will be created if it doesn’t exist. Relative paths are resolved from the server’s working directory.
§Default
"data" (relative to the server’s working directory)
§Environment Variables
OS__HIGH_VOLUME_STORAGE__TYPE=filesystemOS__HIGH_VOLUME_STORAGE__PATH=/path/to/storage
Or for long-term storage:
OS__LONG_TERM_STORAGE__TYPE=filesystemOS__LONG_TERM_STORAGE__PATH=/path/to/storage
S3Compatible
S3-compatible storage backend (type "s3compatible").
Supports Amazon S3 and other S3-compatible services. Authentication is handled via
environment variables (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) or IAM roles.
§Example
long_term_storage:
type: s3compatible
endpoint: https://s3.amazonaws.com
bucket: my-bucketFields
endpoint: StringS3 endpoint URL.
Examples: https://s3.amazonaws.com, http://localhost:9000 (for MinIO)
§Environment Variables
OS__HIGH_VOLUME_STORAGE__TYPE=s3compatibleOS__HIGH_VOLUME_STORAGE__ENDPOINT=https://s3.amazonaws.com
Or for long-term storage:
OS__LONG_TERM_STORAGE__TYPE=s3compatibleOS__LONG_TERM_STORAGE__ENDPOINT=https://s3.amazonaws.com
Gcs
Google Cloud Storage backend (type "gcs").
Stores objects in Google Cloud Storage (GCS). Authentication uses Application Default
Credentials (ADC), which can be provided via the GOOGLE_APPLICATION_CREDENTIALS
environment variable or GCE/GKE metadata service.
Note: The bucket must be pre-created with the following lifecycle policy:
daysSinceCustomTime: 1 dayaction: delete
§Example
long_term_storage:
type: gcs
bucket: objectstore-bucketFields
endpoint: Option<String>Optional custom GCS endpoint URL.
Useful for testing with emulators. If None, uses the default GCS endpoint.
§Default
None (uses default GCS endpoint)
§Environment Variables
OS__HIGH_VOLUME_STORAGE__TYPE=gcsOS__HIGH_VOLUME_STORAGE__ENDPOINT=http://localhost:9000(optional)
Or for long-term storage:
OS__LONG_TERM_STORAGE__TYPE=gcsOS__LONG_TERM_STORAGE__ENDPOINT=http://localhost:9000(optional)
BigTable
Google Bigtable backend (type "bigtable").
Stores objects in Google Cloud Bigtable, a NoSQL wide-column database. This backend is optimized for high-throughput, low-latency workloads with small objects. Authentication uses Application Default Credentials (ADC).
Note: The table must be pre-created with appropriate column families. Ensure to have the following column families:
fg: timestamp-based garbage collection (maxage=1s)fm: manual garbage collection (no GC policy)
§Example
high_volume_storage:
type: bigtable
project_id: my-project
instance_name: objectstore
table_name: objectstoreFields
endpoint: Option<String>Optional custom Bigtable endpoint.
Useful for testing with emulators. If None, uses the default Bigtable endpoint.
§Default
None (uses default Bigtable endpoint)
§Environment Variables
OS__HIGH_VOLUME_STORAGE__TYPE=bigtableOS__HIGH_VOLUME_STORAGE__ENDPOINT=localhost:8086(optional)
Or for long-term storage:
OS__LONG_TERM_STORAGE__TYPE=bigtableOS__LONG_TERM_STORAGE__ENDPOINT=localhost:8086(optional)
project_id: StringGCP project ID.
The Google project ID (not project number) containing the Bigtable instance.
§Environment Variables
OS__HIGH_VOLUME_STORAGE__PROJECT_ID=my-projectOS__LONG_TERM_STORAGE__PROJECT_ID=my-project
instance_name: StringBigtable instance name.
§Environment Variables
OS__HIGH_VOLUME_STORAGE__INSTANCE_NAME=my-instanceOS__LONG_TERM_STORAGE__INSTANCE_NAME=my-instance
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Storage
impl<'de> Deserialize<'de> for Storage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);