pub enum ConfigSource {
File(PathBuf),
Http(String),
S3 {
bucket: String,
key: String,
},
Gcs {
bucket: String,
object: String,
},
Azure {
container: String,
blob: String,
},
AppConfig {
application: String,
environment: String,
profile: String,
},
AzureAppConfig {
store: String,
key: String,
label: Option<String>,
},
DynamoDb {
table: String,
id: String,
key: Option<String>,
value: Option<String>,
},
Firestore {
project: String,
document: String,
database: Option<String>,
field: Option<String>,
},
Cosmos {
account: String,
database: String,
container: String,
id: String,
pk: Option<String>,
field: Option<String>,
},
}Variants§
File(PathBuf)
Http(String)
https://, or http:// to a loopback host only.
S3
Gcs
Azure
AppConfig
An AWS AppConfig configuration profile.
AzureAppConfig
One key-value of an Azure App Configuration store; no label
means the unlabelled value.
DynamoDb
A DynamoDB item, read by its string partition key (attribute
key, default id); the YAML is in attribute value (default
config).
Firestore
A Firestore document (collection/doc, possibly nested); the
YAML is in string field field (default config).
Cosmos
A Cosmos DB item, read by id; its partition key value is pk, or
the id itself. The YAML is in string property field (default
config).
Implementations§
Source§impl ConfigSource
impl ConfigSource
Sourcepub fn parse(raw: &str) -> Result<Self, SignalError>
pub fn parse(raw: &str) -> Result<Self, SignalError>
Parses a $SIGNAL_CONFIG value. Anything without a recognised
scheme is a local path.
Sourcepub fn parse_list(raw: &str) -> Result<Vec<Self>, SignalError>
pub fn parse_list(raw: &str) -> Result<Vec<Self>, SignalError>
Parses a $SIGNAL_CONFIG value that lists one or more files,
comma separated, lowest priority first.
Sourcepub fn discover() -> Result<Option<Vec<Self>>, SignalError>
pub fn discover() -> Result<Option<Vec<Self>>, SignalError>
$SIGNAL_CONFIG if set, else ./signal.yaml if it exists. A
local $SIGNAL_CONFIG path that is not a file is an error rather
than a silent fall back to defaults.
Sourcepub fn join(&self, reference: &str) -> Result<Self, SignalError>
pub fn join(&self, reference: &str) -> Result<Self, SignalError>
Resolves an extends entry of this file. A URL or an absolute
path is taken as is; anything else is relative to this file’s
own location, in the same bucket, container or directory.
A remote file may only extend other remote files: a config served over the network must not be able to read local paths.
Sourcepub fn check_supported(&self) -> Result<(), SignalError>
pub fn check_supported(&self) -> Result<(), SignalError>
Whether this build can read the source at all, either natively
or through a registered ExternalFetcher. A missing one is an
install problem, not an outage, so it fails loudly instead of
falling back.
pub fn is_remote(&self) -> bool
Sourcepub async fn fetch(&self) -> Result<String, SignalError>
pub async fn fetch(&self) -> Result<String, SignalError>
Reads the raw (uninterpolated) config text from the source.
Trait Implementations§
Source§impl Clone for ConfigSource
impl Clone for ConfigSource
Source§fn clone(&self) -> ConfigSource
fn clone(&self) -> ConfigSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigSource
impl Debug for ConfigSource
Source§impl Display for ConfigSource
impl Display for ConfigSource
impl Eq for ConfigSource
Source§impl PartialEq for ConfigSource
impl PartialEq for ConfigSource
impl StructuralPartialEq for ConfigSource
Auto Trait Implementations§
impl Freeze for ConfigSource
impl RefUnwindSafe for ConfigSource
impl Send for ConfigSource
impl Sync for ConfigSource
impl Unpin for ConfigSource
impl UnsafeUnpin for ConfigSource
impl UnwindSafe for ConfigSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.