Expand description
Machinery the dynamic-config store crates share.
This crate has no stable API. It is published only because the seven
store crates are published and cargo will not let a published crate depend
on one that is not. Depend on dynamic-config-consul, -etcd,
-firestore, -nats, -redis, -s3 or -vault; nothing here
is meant to be named directly, and anything here may change in a patch
release.
What lives here is what was identical in more than one store crate and carried a decision worth making once:
attempts— where a watch loop reports an attempt that came back with nothing, so a store that has stopped answering stops looking healthy. Seven loops, one line each.credential— when to obtain, reuse and refresh a token that expires. Consul, Vault and Firestore each kept a copy; the differences between them stayed in the stores, and that module’s documentation says which and why.documents— folding several keys into the one documentfetchreturns: the ordering rule, the collision report, and the limits an untrusted key list is held to. Three stores read several keys and all three would otherwise have written the same merge.guarded— running a watch callback with a panic net. Seven copies, byte for byte.redactedandredacted_list— removing a credential from a store URL before it reaches an error message. Two copies, differing in one documented way that is now a parameter rather than a fork.tls— a custom certificate authority and a client certificate, as data rather than as whichever type the store’s client happens to use. Not a deduplication of seven copies: there were none, and four stores had no way to say it at all.
What is deliberately not here: each store’s retry policy, its timeout
default, and the vocabulary it sorts its own failures with. Those look
alike from a distance and are different decisions up close — a Vault 403
and a Firestore 401 mean the same thing to a person and nothing to a
match.
Modules§
- attempts
- Reporting a watch loop’s failed attempts to reach its store.
- credential
- A credential that expires, and getting another one before it does.
- documents
- Folding several keys into the one document
fetchreturns. - tls
- One TLS vocabulary for the seven store crates.
Enums§
- Lone
Authority - What a URL authority with no colon in it means.
Functions§
- guarded
- Runs the watch callback with a panic net.
- redacted
- A URL with its credentials removed, for error messages.
- redacted_
list - A comma-separated list of URLs, each redacted by
redacted.