forked from docker/labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cs
26 lines (23 loc) · 850 Bytes
/
Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
namespace ProductLaunch.Messaging
{
public class Config
{
private static Dictionary<string, string> _Values = new Dictionary<string, string>();
public static string MessageQueueUrl { get { return Get("MESSAGE_QUEUE_URL"); } }
private static string Get(string variable)
{
if (!_Values.ContainsKey(variable))
{
var value = Environment.GetEnvironmentVariable(variable, EnvironmentVariableTarget.Machine);
if (string.IsNullOrEmpty(value))
{
value = Environment.GetEnvironmentVariable(variable, EnvironmentVariableTarget.Process);
}
_Values[variable] = value;
}
return _Values[variable];
}
}
}