You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
736 B
27 lines
736 B
3 years ago
|
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; }
|
||
|
|
||
|
public static PostgresOptions GetOptions()
|
||
|
{
|
||
|
var config = new ConfigurationBuilder()
|
||
|
.AddEnvironmentVariables()
|
||
|
.Build();
|
||
|
|
||
|
var postgresOptions = new PostgresOptions();
|
||
|
config.GetSection("Lidarr:Postgres").Bind(postgresOptions);
|
||
|
|
||
|
return postgresOptions;
|
||
|
}
|
||
|
}
|
||
|
}
|