Radarr/src/NzbDrone.Core/Datastore/PostgresOptions.cs

27 lines
739 B
C#
Raw Normal View History

2022-03-28 20:46:21 +00:00
using Microsoft.Extensions.Configuration;
namespace NzbDrone.Core.Datastore
{
public class PostgresOptions
{
public string Host { get; set; }
public int Port { get; set; }
public string User { get; set; }
public string Password { get; set; }
public string MainDb { get; set; }
public string LogDb { get; set; }
2022-03-28 20:46:21 +00:00
public static PostgresOptions GetOptions()
{
var config = new ConfigurationBuilder()
.AddEnvironmentVariables("Radarr__")
.Build();
var postgresOptions = new PostgresOptions();
config.GetSection("Postgres").Bind(postgresOptions);
return postgresOptions;
}
}
}