aboutsummaryrefslogtreecommitdiff
path: root/src/util/config.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-10-03 16:23:02 +0000
committerAlex <alex@adnab.me>2023-10-03 16:23:02 +0000
commit1243db87f2090a3302c7c8beb386e68ddf9b66b5 (patch)
tree7280b64fd8ef63be32f27f44f26f0ee7c8ca44be /src/util/config.rs
parent16aa418e473a5e9ef229060d20f6eb280df272a2 (diff)
parent6f8a87814be502ecaee49cd37616ec7fe4c5b588 (diff)
downloadgarage-1243db87f2090a3302c7c8beb386e68ddf9b66b5.tar.gz
garage-1243db87f2090a3302c7c8beb386e68ddf9b66b5.zip
Merge pull request 'Add support for binding to unix domain sockets' (#640) from networkException/garage:unix-sockets into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/640
Diffstat (limited to 'src/util/config.rs')
-rw-r--r--src/util/config.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/util/config.rs b/src/util/config.rs
index 724f9404..ebcb5fbe 100644
--- a/src/util/config.rs
+++ b/src/util/config.rs
@@ -7,6 +7,7 @@ use std::path::PathBuf;
use serde::{de, Deserialize};
use crate::error::Error;
+use crate::socket_address::UnixOrTCPSocketAddress;
/// Represent the whole configuration
#[derive(Deserialize, Debug, Clone)]
@@ -102,7 +103,7 @@ pub struct Config {
#[derive(Deserialize, Debug, Clone)]
pub struct S3ApiConfig {
/// Address and port to bind for api serving
- pub api_bind_addr: Option<SocketAddr>,
+ pub api_bind_addr: Option<UnixOrTCPSocketAddress>,
/// S3 region to use
pub s3_region: String,
/// Suffix to remove from domain name to find bucket. If None,
@@ -114,14 +115,14 @@ pub struct S3ApiConfig {
#[derive(Deserialize, Debug, Clone)]
pub struct K2VApiConfig {
/// Address and port to bind for api serving
- pub api_bind_addr: SocketAddr,
+ pub api_bind_addr: UnixOrTCPSocketAddress,
}
/// Configuration for serving files as normal web server
#[derive(Deserialize, Debug, Clone)]
pub struct WebConfig {
/// Address and port to bind for web serving
- pub bind_addr: SocketAddr,
+ pub bind_addr: UnixOrTCPSocketAddress,
/// Suffix to remove from domain name to find bucket
pub root_domain: String,
}
@@ -130,7 +131,7 @@ pub struct WebConfig {
#[derive(Deserialize, Debug, Clone, Default)]
pub struct AdminConfig {
/// Address and port to bind for admin API serving
- pub api_bind_addr: Option<SocketAddr>,
+ pub api_bind_addr: Option<UnixOrTCPSocketAddress>,
/// Bearer token to use to scrape metrics
pub metrics_token: Option<String>,