Initial commit carried over from private repo. This is V2.
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m3s
Build and Push Docker Image / docker (push) Successful in 43s

This commit is contained in:
2025-07-04 21:24:12 +02:00
parent 7715816029
commit 4393977389
96 changed files with 3223 additions and 0 deletions

View File

@ -0,0 +1,20 @@
namespace MessengerApi.Configuration
{
public static partial class Constants
{
public static class EnvironmentVariables
{
public const string SQL_CONNECTIONSTRING = nameof(SQL_CONNECTIONSTRING);
public const string NPG_CONNECTIONSTRING = nameof(NPG_CONNECTIONSTRING);
public const string PERSISTENCE_TYPE = nameof(PERSISTENCE_TYPE);
public const string CORS_ORIGINS = nameof(CORS_ORIGINS);
public const string PROXIES = nameof(PROXIES);
public const string QUERY_RATE_PER_MINUTE = nameof(QUERY_RATE_PER_MINUTE);
public const string DEFAULT_MESSAGE_LIFETIME_IN_MINUTES = nameof(DEFAULT_MESSAGE_LIFETIME_IN_MINUTES);
public const string HOUSEKEEPING_ENABLED = nameof(HOUSEKEEPING_ENABLED);
public const string HOUSEKEEPING_MESSAGE_AGE_IN_MINUTES = nameof(HOUSEKEEPING_MESSAGE_AGE_IN_MINUTES);
public const string HOUSEKEEPING_MESSAGE_STATE = nameof(HOUSEKEEPING_MESSAGE_STATE);
public const string LOGGING_VERBOSITY = nameof(LOGGING_VERBOSITY);
}
}
}

View File

@ -0,0 +1,15 @@
namespace MessengerApi.Configuration.Sources.Environment
{
public class EnvironmentConfigurationSource : IEnvironmentConfigurationSource
{
public bool HasKey(string key)
{
return !string.IsNullOrWhiteSpace(System.Environment.GetEnvironmentVariable(key));
}
public T GetValue<T>(string key)
{
return (T)Convert.ChangeType(System.Environment.GetEnvironmentVariable(key), typeof(T));
}
}
}

View File

@ -0,0 +1,6 @@
namespace MessengerApi.Configuration.Sources.Environment
{
public interface IEnvironmentConfigurationSource : IConfigurationSource
{
}
}