diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-03-11 11:14:41 +0100 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-03-11 11:18:08 +0100 |
commit | 5c51a9bdafda4987ab7da52b816e01ea6b56502d (patch) | |
tree | a3df26957e60bd627961e59a18e27445cd9b303a /src/commands/endpoint_container.rs | |
parent | d8cc10deecb954613c1a7a6465fd4de3efbbc9c4 (diff) |
Endpoint configuration as Map
This patch rewrites the endpoint configuration format to be a map.
The problem here is, that a list of endpoints cannot easily be used with layered
configuration, where a part of the configuration lives in the XDG config home of
the user and the rest lives in the repository.
With this patch, the endpoints are configured with a map instead of an array,
which makes it less complicated to overwrite.
The name of an endpoint is now the key in the map.
A type `EndpointName` was introduced to take advantage of strong typing. Thus,
the patch touches a bit more code to adapt to the new type in use.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/commands/endpoint_container.rs')
-rw-r--r-- | src/commands/endpoint_container.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/commands/endpoint_container.rs b/src/commands/endpoint_container.rs index 1861cc7..962b62c 100644 --- a/src/commands/endpoint_container.rs +++ b/src/commands/endpoint_container.rs @@ -18,8 +18,9 @@ use tokio_stream::StreamExt; use shiplift::Container; use crate::config::Configuration; +use crate::config::EndpointName; -pub async fn container(endpoint_names: Vec<String>, +pub async fn container(endpoint_names: Vec<EndpointName>, matches: &ArgMatches, config: &Configuration, ) -> Result<()> { |