refatco and cleanup
This commit is contained in:
parent
94eb8e2fff
commit
4d51267dfd
66 changed files with 32 additions and 1619 deletions
|
|
@ -1,40 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using isnd.Entities;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Unleash;
|
||||
using Unleash.ClientFactory;
|
||||
|
||||
namespace isnd.Helpers
|
||||
{
|
||||
/**
|
||||
* Helper class for creating an Unleash client.
|
||||
*/
|
||||
public static class UnleashHelpers
|
||||
{
|
||||
/**
|
||||
* Creates an Unleash client using the provided environment and settings.
|
||||
* @param env The web host environment.
|
||||
* @param unleashClientSettings The settings for the Unleash client.
|
||||
* @returns An instance of IUnleash.
|
||||
*/
|
||||
|
||||
public static IUnleash CreateUnleashClient(this IWebHostEnvironment env,
|
||||
UnleashClientSettings unleashClientSettings)
|
||||
{
|
||||
var unleashSettings = new UnleashSettings
|
||||
{
|
||||
UnleashApi = new Uri(unleashClientSettings.ApiUrl),
|
||||
AppName = "isnd",
|
||||
InstanceTag = env.EnvironmentName,
|
||||
CustomHttpHeaders = new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization", unleashClientSettings.ClientApiKey }
|
||||
}
|
||||
};
|
||||
|
||||
UnleashClientFactory unleashClientFactory = new UnleashClientFactory();
|
||||
return unleashClientFactory.CreateClient(unleashSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue